Hi all,
Is there any way to create a alias-like method allowing arguments not
to be separated by comma?
def my_alias(from, to)
…
end
myalias :me :you
thx
blambeau
Hi all,
Is there any way to create a alias-like method allowing arguments not
to be separated by comma?
def my_alias(from, to)
…
end
myalias :me :you
thx
blambeau
LAMBEAU Bernard wrote:
thx
blambeau
Nope, alias is a keyword, not a method, so it has special syntax.
As we discuss already some weird issues on this list:
Wouldn’t it be possible to add some more “syntactic sugar” to Ruby?
What about a “operator” which uses rest of current line as string
argument?
Example:
def interprete s
p s.split
end
interprete: 1 2 3
should show [“1”, “2”, “3”]…
Or, possibly, put ‘:’ at the end of param-list:
def interprete s:
…
“Joel VanderWerf” [email protected] schrieb im Newsbeitrag
news:[email protected]…
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs