|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Ruboids:
I figured Doctor Why's eloquent Shoes project would look even better under Ruby 1.9, so I recompiled it there. (Note to those who should hope to keep their C extensions portable: RSTRING(str)->ptr should be RSTRING_PTR(str). Other than that, it's a credit to both _why and the Matz Faction that Why's code had no other C syntax errors. We'll keep PLATFORM for RUBY_PLATFORM our little secret. ![]() I'm here for some nice syntactic sugar that makes highly optional GUI systems, such as Rails or Shoes, much easier on the fingers. This... oval :left => x, :top => y, :radius => i, :center => true ....becomes this: oval left: x, top: y, radius: i, center: true That looks kind'a slick, huh? It reminds us of certain other languages that provide "named optional parameters". Maybe those languages are still better than Ruby - in that feature - because they didn't need to retrofit support for it, huh? The problem with those languages is they provide that feature using "magic". They parse method calls differently from other statements. The problem with "magic" in a language syntax is simple. Everything the language can do, a programmer should be able to do, the same way. Here's a method definition from a language that added named optional parameters at the parser level: def info(object, spacing=10, collapse=1): Call that with info(odbcer, collapse=0), for example. The problem with this language is you can't do what the language does. You don't have the option to manipulate hashes of symbols as named optional arguments, and vice versa. Ruby will soon catch up to other languages, and we did it via emergent design, not planned design. Props, Matz! -- Phlip |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Someone replied:
> FAIK, PLATFORM is there since a long ago (1.8.6 and 1.8.5 have it). > > I just used to look for RUBY_PLATFORM ;-) PLATFORM ain't there no more - good riddance. Everything in Ruby about Ruby should start with rb or RUBY_. "Registered Package Prefix." > Yeah, great things for 1.9 and Shoes! > > I only wish Shoes can be used without being a "wrap" around the > interpreter and can be usable as a extension. > > But I know _why is creating Shows for HacketyHack, so I will not > scream for it (too much) :-D But that's just the thing. Ruby makes extensions so danged easy that you can probably just jump into whatever main() calls, and rb_require the shoes.rb wrappers in... -- Phlip |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Mar 31, 1:14 am, "Phlip" <phlip2...@gmail.com> wrote:
> Someone replied: > > > FAIK, PLATFORM is there since a long ago (1.8.6 and 1.8.5 have it). > > > I just used to look for RUBY_PLATFORM ;-) > > PLATFORM ain't there no more - good riddance. Everything in Ruby about Ruby > should start with rb or RUBY_. "Registered Package Prefix." > Was Google groups and keyboard shortcuts fault! ;-) Nice I've been using RUBY_PLATFORM since long time ago :-D > > Yeah, great things for 1.9 and Shoes! > > > I only wish Shoes can be used without being a "wrap" around the > > interpreter and can be usable as a extension. > > > But I know _why is creating Shows for HacketyHack, so I will not > > scream for it (too much) :-D > > But that's just the thing. Ruby makes extensions so danged easy that you can > probably just jump into whatever main() calls, and rb_require the shoes.rb > wrappers in... > Yeah, creating extensions isn't complex, but can get tricky manage the resources and memory allocation... :-P Anyway, just a wish, don't have enough time to do it right now :-D Regards, -- Luis Lavena |
|
![]() |
| Outils de la discussion | |
|
|