Re: Phix:optional/named Parameter inside a class unexpected behavior?
- Posted by petelomax Dec 31, 2023
- 1141 views
?adc -- unexpected result no crash/why?
routines became first-class in 0.8.2 (I think), so the absense of a following '(', which would obviously make it an invocation of that routine, makes it equivalent to [?]routine_id("adc").
Likewise, <int>(x,y) became equivalent (depending on context) to call_func/proc(<int>,{x,y}), and, before you ask, there'll never be named parameter support on that.
(well, I suppose I am already half-planning some rather radical rewrites for 2.0, so never say never...)
class two function add(integer x=1,integer y=1) return x+y end function end class --?addfunc.add(x:=2) --crash with undefined identifier x unexpected
Erm/ah, named parameters on class methods is probably just something I have simply never even tried. Might take me a while to figure out a fix for that.
It may well be too tied in to the aformentioned call_func/proc() mods, and simply prove impractical (at least, as above, pre-2.0, which is probably at least two or three years away).

