ruby wish-list

This is a discussion on ruby wish-list within the RUBY forums in Programming Languages category; On Nov 5, 2007, at 3:27 AM, Roger Pack wrote: > Another wish list item would be being able to use "a {var_name}" > instead > of "a #{var_name}" I hate that extra pound, as it reminds me of > perl "a %s" % var_name a @ http://codeforpeople.com/ -- it is not enough to be compassionate. you must act. h.h. the 14th dalai lama...

Go Back   Application Development Forum > Programming Languages > RUBY

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #21  
Old 11-06-2007, 05:23 PM
ara.t.howard
Guest
 
Default Re: ruby wish-list


On Nov 5, 2007, at 3:27 AM, Roger Pack wrote:

> Another wish list item would be being able to use "a {var_name}"
> instead
> of "a #{var_name}" I hate that extra pound, as it reminds me of
> perl


"a %s" % var_name

a @ http://codeforpeople.com/
--
it is not enough to be compassionate. you must act.
h.h. the 14th dalai lama




Reply With Quote
  #22  
Old 11-06-2007, 05:31 PM
ara.t.howard
Guest
 
Default Re: ruby wish-list


On Nov 5, 2007, at 1:28 PM, Roger Pack wrote:

>
> I wonder if that fact that regex's always with have two /'s might
> help...
>


probably not - unless you wanted to introduce ';'s to ruby too:


cfp:~ > cat a.rb
x = 1

result =
x / 4 * 2 /
42
p result

def x(*re) 'forty-two' end

result =
x / 4 * 2 /
42
p result

result =
x(/ 4 * 2 /)
42
p result


cfp:~ > ruby a.rb
0
0
"forty-two"



a @ http://codeforpeople.com/
--
share your knowledge. it's a way to achieve immortality.
h.h. the 14th dalai lama



Reply With Quote
  #23  
Old 11-06-2007, 06:36 PM
Roger Pack
Guest
 
Default Re: ruby wish-list


>
> probably not - unless you wanted to introduce ';'s to ruby too:
>
>
> cfp:~ > cat a.rb
> x = 1
>
> result =
> x / 4 * 2 /
> 42
> p result
>


Dang that does seem ambiguous then. Ahh well.

My latest wish is that
unexpected $end, expecting kEND

would say something less cryptic--like "unexpected $end (end of file)
expected word "end" "
--
Posted via http://www.ruby-forum.com/.

Reply With Quote
  #24  
Old 11-07-2007, 10:26 AM
Rick DeNatale
Guest
 
Default Re: ruby wish-list

On 11/6/07, Roger Pack <rogerpack2005@gmail.com> wrote:
> > Take care.
> > -Roger

>
> I wish... that Range.to_a wouldn't become obselete, as it seems quite useful
> in rails!


Assuming you mean Range#to_a (i.e. an instance rather that class
method) I don't think it's becoming obsolete.

There was talk some time ago when Matz changed 1.9 to use to_splat
instead of to_a that ranges wouldn't be splatted, e.g.

a = *(1..3)

In 1.8 this sets a to [1,2,3] whereas at one time in 1.9 it was to
have set it to [(1..3)].

But testing with a fairly recent irb1.9 this seems to be one of the
changes which has been backed out of 1.9.


--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Reply With Quote
  #25  
Old 11-11-2007, 01:13 AM
Roger Pack
Guest
 
Default Re: ruby wish-list

>> I wish... that Range.to_a wouldn't become obselete, as it seems quite useful
>> in rails!

>
> Assuming you mean Range#to_a (i.e. an instance rather that class
> method) I don't think it's becoming obsolete.


It throws warnings as deprecated, for some reason. I like it!

And my latest wish
variables that can end in ?
Oh wishing star...
Take care all!
-Roger
--
Posted via http://www.ruby-forum.com/.

Reply With Quote
  #26  
Old 11-11-2007, 04:58 AM
Damien Merenne
Guest
 
Default Re: ruby wish-list

Hello,

On Sun, Nov 11, 2007 at 03:13:07PM +0900, Roger Pack wrote:
> And my latest wish
> variables that can end in ?


Mmm I'd like that too.

Regards,

--
Damien MERENNE <dam@cosinux.org>
http://blog.cosinux.org/



Reply With Quote
  #27  
Old 11-11-2007, 10:10 AM
Rick DeNatale
Guest
 
Default Re: ruby wish-list

On Nov 11, 2007 1:13 AM, Roger Pack <rogerpack2005@gmail.com> wrote:
> >> I wish... that Range.to_a wouldn't become obselete, as it seems quite useful
> >> in rails!

> >
> > Assuming you mean Range#to_a (i.e. an instance rather that class
> > method) I don't think it's becoming obsolete.

>
> It throws warnings as deprecated, for some reason.


I don't think so:

shadowfax:~/Documents/terralien/dltsolutions/enrollnow rick$ ruby1.9 -v
ruby 1.9.0 (2007-10-25 patchlevel 0) [i686-darwin8.10.2]
shadowfax:~/Documents/terralien/dltsolutions/enrollnow rick$ ruby1.9
-we '(1..3).to_a'
shadowfax:~/Documents/terralien/dltsolutions/enrollnow rick$ ruby1.9
-we 'p (1..3).to_a'
-e:1: warning: (...) interpreted as grouped expression
[1, 2, 3]
shadowfax:~/Documents/terralien/dltsolutions/enrollnow rick$ ruby1.9
-we 'p((1..3).to_a)'
[1, 2, 3]



--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Reply With Quote
  #28  
Old 11-11-2007, 10:26 AM
Marc Heiler
Guest
 
Default Re: ruby wish-list

"unless you wanted to introduce ';'s to ruby too:"

Hopefully a mandatory ; on the end of each line, as is the case with
perl,
will NEVER appear in Ruby ... but then again who would wish for bad
stuff ;-)


"variables that can end in ?"

I dont like this, mostly because we can use method calls such as
dragon.hungry?

And I would not want to have a variable inside the dragon that
has something like ... i dont know

hungry? = true

I'd rather have a variable that would state
is_hungry = true

instead and then query if the dragon is hungry by using either
is_hungry? or hungry?

(By the way, an accessor_read that can query variables with ? on the end
would
be nice in std ruby too... I am not complaining at all, ruby is so
flexible,
I already use this for my code and i love it, like @file.readable? that
queries a "special" reader accessor... i think it reads nicer than
@file.readable but this is just my opinion)


But I know what i would like to REALLY have:

* real keyword arguments in 2.0

:-)
--
Posted via http://www.ruby-forum.com/.

Reply With Quote
  #29  
Old 11-15-2007, 10:33 AM
Roger Pack
Guest
 
Default Re: ruby wish-list

>
> * real keyword arguments in 2.0
>
> :-)


Not sure what those are.

My latest wish, oh wishing star...

(I think something in osx does this)

begin_funcion_name param1 keep_going_function_name param2 end

# so you can have your function calls read really like English

run_if_queue_below 24 every 24 seconds

yeah
Stay well.
-Roger
--
Posted via http://www.ruby-forum.com/.

Reply With Quote
  #30  
Old 11-15-2007, 11:21 AM
Roger Pack
Guest
 
Default Re: ruby wish-list

Roger Pack wrote:
>>
>> * real keyword arguments in 2.0
>>
>> :-)

>

and the ability to parse .25 as a float, instead of 0.25
--
Posted via http://www.ruby-forum.com/.

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:41 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.