|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D - Lisp/Ruby style symbols
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? Aug 05 2007
Alex wrote: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? Aug 05 2007
|