Computer Forum  

Go Back   Computer Forum > Computer Forums > Programming Forum > Ruby Forum

Ruby Forum Ruby on Rails Programming Forum.


Aliasing and the back-quote

Ruby Forum

Ruby on Rails Programming Forum.


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-04-2004, 09:09 PM
Robert Peirce
Guest
 
Posts: n/a
Robert Peirce RSS Feed
Aliasing and the back-quote

--Apple-Mail-7--800787163
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=ISO-8859-1;
format=flowed

On page 232 of the Ruby book, there is the following code:

alias :cmd :`
cmd "date"

which works. However,

` "date"

does not work, although

`"date"`

does. Why does cmd work without a second back-quote while a single=20
back-quote does not work at all?

Bob Peirce Venetia, PA =20=

724-941-6883
bob@peirce-family.com [HOME (Mac)]
rbp@cooksonpeirce.com [OFFICE]

There is=A0 only one basic human=A0 right, the=A0 right to do as you =
damn well
please.=A0 And with it comes the only basic human duty, the duty to take
the consequences.=A0 -- P.J. O'Rourke

--Apple-Mail-7--800787163--


Reply With Quote
  #2 (permalink)  
Old 03-04-2004, 09:16 PM
Hal Fulton
Guest
 
Posts: n/a
Hal Fulton RSS Feed
Aliasing and the back-quote

Robert Peirce wrote:

My best guess would be something like this:

The bactick is a special case, with a special syntax. It's the only
method (I can think of) that is called by two syntactic instances
surrounding its argument. This is for historical reasons. It's all
handled in the parser as a special case.

If you alias this "unusual" name to a "normal" name, they will both
behave as they normally would, with no special treatment either way.

Does this non-answer make any sense?

Hal



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Aliasing an URL ewijaya HTML Forum 1 05-03-2007 01:18 PM
Single Quote Versus Double Quote In A href link knee-dragger@hotmail.com HTML Forum 3 06-13-2006 12:42 AM
[BUG] Aliasing :lambda Florian Gross Ruby Forum 2 02-29-2004 09:35 AM
Aliasing operators possible? GGarramuno Ruby Forum 1 12-31-2003 11:04 PM
Anti-Aliasing Philipp Neuhaus Nvidia Video Card Forum 4 09-06-2003 12:11 AM


All times are GMT. The time now is 04:40 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93