Re: [phix] puts error message
- Posted by petelomax Mar 19, 2021
- 791 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.