Arc Forumnew | comments | leaders | submitlogin
1 point by dido 6106 days ago | link | parent

It's supposed to be a predicate for a non-nil atom. I just realize that could better be written as (~acons current) instead, given that (acons nil) is also nil.


2 points by eds 6105 days ago | link

I was confused because (~no current) is just the same as current by itself, and I didn't realize you wanted to test for non-nil atoms. Obviously (~no current) isn't what you want, because it returns true for lists.

  arc> (~no nil)
  nil
  arc> (~no 'a)
  t
  arc> (~no '(1 2 3))
  t
But I don't think (~acons current) does what you want either. Because (acons nil) is nil, (~acons nil) is true.

  arc> (~acons nil)
  t
  arc> (~acons 'a)
  t
  arc> (~acons '(1 2 3))
  nil
I think (~alist current) returns true for non-nil atoms, because (alist nil) is true.

  arc> (~alist nil)
  nil
  arc> (~alist 'a)
  t
  arc> (~alist '(1 2 3))
  nil

-----