Arc Forumnew | comments | leaders | submitlogin
Nondeterministic regular expressions library in native arc (lisperati.com)
21 points by drcode 5914 days ago | 3 comments


2 points by almkglor 5913 days ago | link

Cute.^^

Native Arc as in ArcN?

For porting into Anarki, I suggest you use the new 'thread-local types for global variables:

  wipe.re-text*
  wipe.re-paths*
  wipe.re-fail
=>

  (= re-text*  (thread-local)) (wipe (re-text*))
  (= re-paths* (thread-local)) (wipe (re-paths*))
  (= re-fail   (thread-local)) (wipe (re-fail))
You'll need to change all references to globals from say re-text* to (re-text*) though.

This will allow multiple threads to safely use your library in parallel, e.g. in 'asv.

-----

1 point by drcode 5913 days ago | link

That is nice that anarki has thread-local storage... I had stability issues with anarki so I've just been using arc2 with some patches lately... but I've definitely been missing thread-local storage...

-----

1 point by skenney26 5901 days ago | link

Very impressive library.

I had a couple problems running through the examples. Example #5, which is assigning matches to local variables, returns nil. The final example throws the following error:

  Error: "modulo: expects type <integer> as 1st
  argument, given: nil; other arguments were: 2"

-----