1. [phix] puts error message

It is quiet and cold outside...time for some agitation.

puts() 

The result is

puts() 
    ^ missing parameters 

We all (cough, ahem) know that a parameter is a variable defined in a routine, while an argument is a value assigned to a parameter (by way of an argument list.)

Writing an essay as to why Phix|OE gets this wrong, but is ok because everyone gets it wrong, is too much work.

be well
_tom

new topic     » topic index » view message » categorize

2. Re: [phix] puts error message

Indeed. In my (warped) head:

object z = "z\n" 
procedure p(object x, object y=z) 
    ?x -- x is a parameter here 
    puts(1,y) 
end procedure 
 
procedure main() 
    object z = "Z\n" 
    object a = 1 -- set argument a to 1 
    p(a) 
end procedure 
main() 

Somewhere between p(a,b) and p(x,y), my brain is quietly doing a p(x:=a) so they become Schrodinger's cat, both parameter and argument at the same time.
Worse, z is a Schrodinger's cat on steroids. It is both a parameter default and a default argument and neither, and behaves differently on Phix (prints "z") and
Euphoria (prints "Z")... genuinely implemented as a completely different thing in the two languages.

PS I will just note that Phix handles call_proc(routine_id("p"),{a}) with ease, but that's illegal on Euphoria.

new topic     » goto parent     » topic index » view message » categorize

3. Re: [phix] puts error message

_tom said...

It is quiet and cold outside...time for some agitation.

puts() 

The result is

puts() 
    ^ missing parameters 

We all (cough, ahem) know that a parameter is a variable defined in a routine, while an argument is a value assigned to a parameter (by way of an argument list.)

Writing an essay as to why Phix|OE gets this wrong, but is ok because everyone gets it wrong, is too much work.

My machine under EU3.2ru control says:

Syntax error - expected to see an expression, not ')' 
puts() 
     ^ 

Regards


kinz

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu