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:

  1. source file loaded, tokenized (at stage, no operators known)
  2. operator shuffler runs
  3. code evaluated

unfortunately you, you're manipulating operator shuffler after it's run.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -