Arc Forumnew | comments | leaders | submitlogin
2 points by Pauan 4821 days ago | link | parent

And even more fixes. It now works correctly enough that I have switched Arubic[1] over to use import.arc. This allowed me to safely make the changes I described here: http://arclanguage.org/item?id=15147

Now all you need to do is put (use arubic) at the top of your file and you'll be able to use nifty stuff like this:

  (map x foo ...)

  (mapfn prn foo)

  (import bar)

  (cons? foo)

  (isa foo 'cons 'table 'int)
Speed seems acceptable to me, though it is slower than using Arc directly (no namespaces, no Arubic, etc).

I've also been working on fexprs, writing a (much) better ssyntax parser, and a reader written in Arc. I plan for at least the ssyntax part to be included in Arubic, and probably the reader as well. I'm undecided about fexprs, mostly because of performance concerns.

---

* [1]: https://github.com/Pauan/ar/blob/lib/arubic.arc



1 point by Pauan 4820 days ago | link

I just had a fun time tracking down what I thought was a bug, but actually wasn't. If you decide to use Arubic and then try to import something, you may end up with an error similar to this:

  > (import-as pprint "arc3.1/pprint.arc")
  Error: can't understand fn arg list 2
What's happening is that it encountered something like the following:

  (map (fn (e) (prn) (ppr e (+ col 2)))
       (nthcdr (1+ n) expr))
But keep in mind Arubic changes the meaning of "map", "all", "some", etc. which then causes the error. The correct thing to do then is to import it in Arc's namespace, rather than Arubic's namespace:

  > (w/arc3 (import-as pprint "arc3.1/pprint.arc"))
  nil

  > pprint
  #<namespace>

  > ppr
  Error: undefined variable: ppr

  > pprint!ppr
  #<fn>

  > (pprint!ppr '(1 2 3 4 5))
  (1 2 3 4 5)nil
I also have an idea for how I can get it to import correctly into Arubic's namespace, without the error.

-----