Arc Forumnew | comments | leaders | submitlogin
4 points by rocketnia 3278 days ago | link | parent

This is a pretty popular topic. http://awwx.ws/localt0 http://arclanguage.org/item?id=11711

The fact that 't can't be rebound is a bit ugly. Its only purpose is to be an arbitrary non-nil value. It doesn't need to be constant just to keep people from breaking things, just like 'car and 'cdr don't need to be constants.

The one rationale I can think of is that code might assume 't is bound to the symbol 't and use the symbol instead of the current value of the variable. However, that only makes a difference when checking whether something is 't, and things should generally be compared to nil instead.

As for rebinding nil, that's a bit worse. It's supposed to be considered identical to (), even on a reader level. In particular, (a b c) and (a b c . nil) are both (a . (b . (c . ()))), so the following are equivalent:

  ; Accept exactly two arguments, ignore them, and return nil.
  
  (def foo (bar baz)
    nil)
  
  (def foo (bar baz . nil)
    nil)
But the following means something totally different:

  ; Accept two or more arguments, ignore the first two, and return the
  ; rest as a list.
  (def foo (bar baz . qux)
    qux)
To make nil into a regular variable, we'd have to change the varargs syntax to avoid ambiguity.

t is (not nil).

In Arc, that would be (no nil). ^_^



1 point by heiz 3277 days ago | link

Thanks for your reply. I think this situation is a bit confusing. I hope in next arc releases it will be revised.

-----