newLISP Fan Club

Forum => Whither newLISP? => Topic started by: Kazimir Majorinc on July 03, 2011, 05:17:19 PM

Title: Why do you use sym?
Post by: Kazimir Majorinc on July 03, 2011, 05:17:19 PM
I'm trying to make review of situations where sym is useful. I use it


  • for generation of expressions processed by programs. For example, here:
http://kazimirmajorinc.blogspot.com/2011/01/enumeration-of-lambda-expressions.html


    • for alpha-conversion, i.e. prevention of symbol clashes when calling macros. It is equivalent of use of (gensym) in other Lisp dialects in macro definition. For example, here

      http://kazimirmajorinc.blogspot.com/2009/12/symbols-as-sexprs.html



    • for bulk definitions of functions or macros using same algorithm, for example, defining operators setq+, setq-, setq* ... such that (setq+ a b) <=> (setq a (+ a b)),  (setq- a b) <=> (setq a (- a b)) ... For example, here

      http://kazimirmajorinc.blogspot.com/2008/06/assignment-macro-beast-unleashed.html



    • for simulation of hash tables - in some other language, I'd use B["011101"], in Newlisp I just use symbol B011101.  For example, here

      http://kazimirmajorinc.blogspot.com/2009/11/relatively-short-propositional-formulas.html


    Do you have some other example of use of sym?
  • Title: Re: Why do you use sym?
    Post by: m i c h a e l on July 04, 2011, 05:54:50 PM
    Quote from: "Kazimir"Do you have some other example of use of sym?


    I mostly use it for expression-building in my language and FOOP experiments, but even then, not very often. So, no, not really :-)



    m i c h a e l