1. [phix] puts error message
- Posted by _tom (admin) Mar 19, 2021
- 910 views
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
2. Re: [phix] puts error message
- Posted by petelomax Mar 19, 2021
- 898 views
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.
3. Re: [phix] puts error message
- Posted by kinz Mar 20, 2021
- 870 views
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