| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#21
| |||
| |||
| 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 |
|
#22
| |||
| |||
| 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 |
|
#23
| |||
| |||
| > > 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/. |
|
#24
| |||
| |||
| 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/ |
|
#25
| |||
| |||
| >> 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/. |
|
#26
| |||
| |||
| 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/ |
|
#27
| |||
| |||
| 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/ |
|
#28
| |||
| |||
| "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/. |
|
#29
| |||
| |||
| > > * 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/. |
|
#30
| |||
| |||
| 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/. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.