From: dblack@... Date: 2003-02-17T23:00:32+09:00 Subject: Re: General programming language question Hi -- On Mon, 17 Feb 2003, Marcin 'Qrczak' Kowalczyk wrote: > Mon, 17 Feb 2003 06:25:47 +0900, Ryan Pavlik pisze: > > > These are all "built in". Why can't you add your own types that > > have their own special syntax? > > Because it's too easy for separately developed syntax extensions > to be incompatible (conflicting). And I'm sure that several modules > would often want to use the same "cute" syntax. > > > varstr = "myvarname" > > sym = varstr.intern # => :myvarname > > sym.bind(42) > > > > p myvarname # => 42 > > In which scope it would create the variable? The behavior of Symbol#bind > would depend on the context where it was called, because local variables > should be lexically scoped. Such implicit context-dependence is ugly and > hard to archieve. There was a discussion of this recently on ruby-core, and Matz said he found it interesting but sees it more as a method of Binding than Symbol. (See thread starting at .) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav