Why do you use sym?

Started by Kazimir Majorinc, July 03, 2011, 05:17:19 PM

Previous topic - Next topic

Kazimir Majorinc

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">http://kazimirmajorinc.blogspot.com/201 ... sions.html">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">http://kazimirmajorinc.blogspot.com/200 ... exprs.html">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">http://kazimirmajorinc.blogspot.com/200 ... ashed.html">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">http://kazimirmajorinc.blogspot.com/200 ... mulas.html">http://kazimirmajorinc.blogspot.com/2009/11/relatively-short-propositional-formulas.html
  • [/list]


    Do you have some other example of use of sym?
    http://kazimirmajorinc.com/\">WWW site; http://kazimirmajorinc.blogspot.com\">blog.

    m i c h a e l

    #1
    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