iolanguage - Io operators, cant seem to create them in a file -
i've being experimenting operators in io language. works fine in cli, put code in files instead, run problems.
here's tiny example (creating operator +++ same thing +)
operatortable addoperator("+++", 3) # +++ should operator number +++ := method(v, call target + v) # define slot +++ on numbers (30 +++ 40) println # try out! as mentioned, works fine in cli, doesn't work when try run in file. presume has fact file has been preparsed, before operator defined, how work around that?
this limitation of operator shuffler in io. happens this:
- source file loaded, tokenized (at stage, no operators known)
- operator shuffler runs
- code evaluated
unfortunately you, you're manipulating operator shuffler after it's run.
Comments
Post a Comment