Arc Forumnew | comments | leaders | submitlogin
3 points by sjs 6173 days ago | link | parent

I'm still digging through the source, haven't done any coding yet. But...

There is a function called 'isnt' I did not see mentioned in the tutorial.

  arc> (isnt 1 2)
  t
Also an 'empty' function that's true for nil, empty lists and strings.

There's subseq, which is sort of like nthcdr but works on lists and strings (any sequence), and takes the seq before the n.

  arc> (subseq "uh, hello world" 4)
  "hello world"
  arc> (subseq (coerce "uh, hello world" 'cons) 4 9)
  (#\h #\e #\l #\l #\o)
'last' gets you the last value in a cons.

  arc> (last '(fee fie foe fum))
  fum
'adjoin' inserts a value into a set, unless already present.

  arc> (adjoin '(1 2) '((5 3) (1 2) (7 4)))
  '((5 3) (1 2) (7 4))
  arc> (adjoin 1 '(2 3 4))
  (1 2 3 4)
'consif' conses a value if it's not nil.

  arc> (consif 'sugar '(coffee cream))
  (sugar coffee cream)
  arc> (consif nil '(coffee milk))
  (coffee milk)
The complement of 'when', pg snuck 'unless' into the arc.arc excerpt at the end.

Make sure you read *.arc after the tutorial to really get a feel for the language.