[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: newbie question re: variable assignment

Simon.Mullis

4/13/2005 9:35:00 PM

Just ordered the 2nd Edition (good old Amazon)...

Woohoo!

SM

-----Original Message-----
From: Gennady Bystritksy [mailto:gfb@tonesoft.com]
Sent: 13 April 2005 21:04
To: ruby-talk ML
Subject: Re: newbie question re: variable assignment


Simon.Mullis@equinoxsolutions.com wrote:
> This is it... Many thanks.
>
> 1.upto(9) { |x| puts "#{x}"[0] }
>
> I was missing the literal form v. method info.
>
> Just so I know -- Where would I look to find this info? Rdoc? ri?

Pickaxe ("Programming Ruby" by Dave Thomas and Andy Hunt).

>
> Thanks again.
>
> SM
>
>
> ...It's all getting a little bit clearer...
>
> -----Original Message-----
> From: Trans [mailto:transfire@gmail.com]
> Sent: 13 April 2005 19:15
> To: ruby-talk ML
> Subject: Re: newbie question re: variable assignment
>
>
> Hi--
> Dont; worry this is a low bite board :-)
>
>
>>Why doesn't this work?
>>
>>1.upto(9) do |x|
>> puts ?#{x}
>>end
>
>
> Well, its cuz you're trying to do string interpolation directly into
> ruby code, which can't be done. The interpolation (i.e. #{x}) only
> works in strings. Secondly, the ? is a literal form and not a method,
> so you can;t pass it arguments. To get the ascii value of a string use

> str[n] where n is the index of the character you wish to convert, in
> this case 0.
>
> 1.upto(9) do |x|
> puts "#{x}"[0]
> end
>
> BTW, I believe this will change in future verions of Ruby since Ruby
> will be gaining more advanced encoding. So instead there will be a
> specific method, like String#ascii(n), or something, to do this.
> [Correct me if I am misinformed all.] But for now the above is the
> way.
>
> T.
>
>
>
> ----------------------------------------------------------------------
> --------------------
> Equinox Converged Solutions
> Tel: +44 (0)1252 405 600
> http://www.equinoxsol...
> Equinox Converged Solutions is a trading name of Synetrix Holdings
Limited.
>
> IMPORTANT NOTICE:
> This message is intended solely for the use of the Individual or
> organisation to whom it is addressed. It may contain privileged or
> confidential information. If you have received this message in error,

> please notify the originator immediately. If you are not the intended
recipient, you should not use, copy, alter, or disclose the contents of
this message. All information or opinions expressed in this message
and/or any attachments are those of the author and are not necessarily
those of Synetrix Holdings Limited. Synetrix Holdings Limited accepts no
responsibility for loss or damage arising from its use, including
damage from virus.
>
------------------------------------------------------------------------
-------------------
>



------------------------------------------------------------------------------------------
Equinox Converged Solutions
Tel: +44 (0)1252 405 600
http://www.equinoxsol...
Equinox Converged Solutions is a trading name of Synetrix Holdings Limited.

IMPORTANT NOTICE:
This message is intended solely for the use of the Individual or organisation to whom it is addressed. It may contain privileged or confidential information. If you have received this message in error, please notify the originator immediately.
If you are not the intended recipient, you should not use, copy, alter, or disclose the contents of this message. All information or opinions expressed in this message and/or any attachments are those of the author and are not necessarily those of Synetrix Holdings Limited.
Synetrix Holdings Limited accepts no responsibility for loss or damage arising from its use, including damage from virus.
-------------------------------------------------------------------------------------------



1 Answer

The Peeler

6/12/2011 9:26:00 PM

0

On Sun, 12 Jun 2011 17:13:22 -0600, The Rectum farted again:

>>
>>It is easier for Nazis like you to be holocausted or for Islam to be
>>destroyed than for Europe to change its present structure.
>
> Not at all, Grik raghead. Countries are added all the time. They can
> just as easily be subtracted.
>
>>So please feel free to continue your sad lives.
>>
>>Unless of course you two blasphemous pieces of skata get holocausted
>>soon.
>
> Only jews are allowed to get 'holocausted'®?. To suggest otherwise is
> 'anti-semitic'®?.

<no snip of all the usual idiotic and psychotic garbage for laughs>

Entertaining everyone with your outstanding idiocy and psychosis again, The
Rectum? LOL

--
The top 5 truths about our resident psychopath, The Rectum:

the desperate psycho can't SLEEP anymore,
he can't get out of the house anymore,
he got NOBODY to talk to anymore,
he can't FUCK anymore,
he got no life outside Usenet AT ALL!