Lisp/Ruby style symbols

Alex CppCoder at gmail.com
Sun Aug 5 10:43:17 PDT 2007


I've been writing a lot of Ruby code lately, and I've really began to appreciate the convenience of certain features (dynamic typing, flexible metaprogramming, etc).  Obviously a lot of these features simply cannot be implemented in D (or would have a very awkward style of implementation), but one little thing that I've found to be very useful are the Lisp style symbols.  For those unfamiliar, it is a concept similar to enumerations, except that instead of having a defined range of values, you simple declare a variable ands set it equal to :name_of_symbol.  This flexibility less code has to be written (no type declaration) and IMHO would make for a nice addition to D.  I'd imagine we could allow something like the following:
sym my_var = :foo;
auto my_var2 = :bar;

any thoughts?  or more importantly, any chance of this actually making it in?



More information about the Digitalmars-d mailing list