Hi --

On Mon, 17 Feb 2003, Marcin 'Qrczak' Kowalczyk wrote:

> Mon, 17 Feb 2003 06:25:47 +0900, Ryan Pavlik <rpav / nwlink.com> 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
<http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/724>.)


David

-- 
David Alan Black
home: dblack / candle.superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav