Arc Forumnew | comments | leaders | submitlogin
2 points by zck 4872 days ago | link | parent

It makes for some interesting coercions:

  arc> ''nil
  (quote nil)
  arc> ''arst
  (quote arst)
  arc> (coerce ''nil 'string)
  "quote"
  arc> (coerce ''arst 'string)
  "quotearst"
I could see this being somewhat useful for printing things where nils might be involved:

  arc> (with (indiana (obj hat 'fedora weapon 'whip)
         vader (obj hat 'helmet weapon 'lightsaber)
         bond (obj weapon 'walther-ppk))
        (coerce (map [_ 'hat]
                     (list indiana vader bond))
                'string))
  "fedorahelmet"
Of course, you can easily remove 'nil from a list of things:

  arc> (with (indiana (obj hat 'fedora weapon 'whip)
         vader (obj hat 'helmet weapon 'lightsaber)
         bond (obj weapon 'walther-ppk))
        (trues idfn
               (map [_ 'hat]
                    (list indiana vader bond))))
  (fedora helmet)