Hi --

On Mon, 21 Mar 2005, Florian Frank wrote:

> David A. Black wrote:
>
>> On Mon, 21 Mar 2005, Florian Frank wrote:
>> I don't think making Ruby resemble other languages makes it
>> *self*-consistent, but rather more consistent with languages other
>> than itself.
>
> Hey, this is the language of my dreams, it does only exist there. In 
> dreamland I am also smart enough, to make my own language, while in reality I 
> have to hope, that my dreams and Matz' are compatible. ;)
>
> Moving from to {} for hashes and {} for blocks, to {} only for blocks and 
> something else for hashes surely does increase self-consistency. This also 
> would make parsing Ruby easier, consider for example this case:
>
> def foo(h) :ok end
>
> foo :hello # => :ok
>
> but
>
> foo {} # => ArgumentError: wrong number of arguments (0 for 1)
>
> while
>
> foo({}) # => :ok

Are you saying you'd like to have foo {} be the same as foo({})
(assuming both are lambdas/blocks)?  But then, what about:

   def foo; end
   foo {}        # called with block, or wrong # of arguments?

As often happens, the solution:

   foo() {}

involves more punctuation :-)

>> I'm also not a big believer in meeting nubies'
>> expectations.  Especially for Ruby 2.0... it's definitely past the
>> point of needing to "make <other language> programmers feel at home."
>> They will, if they like Ruby, and meanwhile it's important for Ruby
>> programmers to feel at home :-)
>
> I don't have any against it, but I fear it's also a trap to rely solely one 
> culture and heritage, while ignoring common sense and human expectation.

But Ruby isn't within miles of having that problem.  My point is that
I don't like the idea of just putting things in Ruby because they are
the culture and heritage of *other* languages.  Nor do I think that if
something is part of the culture and heritage of Ruby, it therefore
has to be removed :-)  (I know you weren't saying that.)

> It's 
> charming to have car and cdr in a language, if you're interested in history, 
> but it's also difficult to justify in any other way than just saying, we 
> always did it that way. For new users that haven't their brains warped 
> already, it's also difficult to understand, that you have to use length($s) 
> to get the length of a string in Perl, while you have to use scalar @a to get 
> the length of an array (or even scalar keys %h for the size of a hash). I'd 
> rather avoid Ruby going into this direction, if it is possible.

My point exactly :-)

When it comes to nubies, I think there's a big difference between (a)
things they might find slightly surprising (but that are actually
completely logical, once you "get" the language), and (b) things that
are going to attract them to the language.  If you say to someone:
Ruby offers you the ability to write top-level scripts, like Perl, and
also has OO designed into it from the ground up -- that might get
their attention.  If you say: As of version 2.0, you don't have to use
the lambda keyword because {} has been repurposed as a function
constructor -- I don't think that's going to make someone go, "Wow!
That sounds like the language for me!" :-)


David

-- 
David A. Black
dblack / wobblini.net