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

There is no example in official Arc. If we're talking hypothetically, here's one way to make sense of it:

  arc> (= x '(2))
  (2)
  arc> (= (~car x) t)
  t
  arc> (~car x)
  t
  arc> x
  (nil)
  arc> (= (~x 0) nil)
  nil
  arc> (~x 0)
  nil
  arc> x
  (t)
Since (~foo ...) only ever returns nil or t, this kind of place can't faithfully store other values:

  arc> (= (~x 0) "something unique and special")
  Error: Can't assign "something unique and special" as boolean
  
  -- or --
  
  arc> (= (~x 0) "something unique and special")
  "something unique and special"
  arc> (~x 0)
  t
I don't see much purpose to implementing this feature, since every time someone would type (= (~foo bar) baz), they could just type (= foo.bar no.baz) instead.