From: ES Date: 2005-03-23T05:57:57+09:00 Subject: Re: Paul Graham recommends Ruby In data 3/22/2005, "David A. Black" ha scritto: >Hi -- > >On Wed, 23 Mar 2005, Steven Shaw wrote: > >> David A. Black wrote: >> >>> Rather, >>> the question is: if Ruby had been designed from the ground up with a >>> literal function constructor, would it have been {|| } ? >> >> Do you mean syntactically? Like instead of Smalltalk like [| ]? or something >> else? > >I mean if Matz had wanted such a constructor from the beginning, what >would he have chosen? So much of the discussion of this and other >changes to Ruby involve just trying to find combinations of >punctuation that aren't already taken.... > >>> If so, then >>> fine. If not, then {|| } would be an add-on that is not properly >>> integrated into the language. >> >> and here, more specifically, "not properly integrated into the language >> syntax"? > >"Properly" meaning "in a non-afterthought way". I'm afraid I can't >express it any more technically than that. But think of all the >things in Perl and Python about which people say: that was slapped on >after the language was already designed. There is essentially none of >that in Ruby, which I think is a great situation and one that should >be conserved. I absolutely agree with you on this and can see how this would be a concern for this particular addition. To me the current HEAD version, where {||} must be used for a no-argument proc definition, falls in this category; while it's useful to be able to omit 'lambda' etc., this method of doing it feels distinctly tacked-on. I'm certainly sympathetic to whoever is writing the parser, of course, and I wouldn't mind the proposed [:]-syntax for Hashes. I maintain that this all could be solved with an unification of all callable code into a single first-order function definition :) >David E