adding an argument to a proc 
Author Message
 adding an argument to a proc

is there a way to add an argument to a proc after its creation?

ex-

p = Proc.new { x + 5 }
px = Proc.new { |x| p.call(5) }

this won't work

--
~transami

  _(")_  dobee dobee do...
   \v/  
   ^ ^



Fri, 07 Jan 2005 16:37:07 GMT  
 adding an argument to a proc

Quote:

> p2 = Proc.new {|y_uNiQuE_VarName|

Ops. You don't have to go nuts on the y like this. I was trying
something and forgot to change the y name back.

--
(\[ Kent Dahl ]/)_    _~_    __[ http://www.stud.ntnu.no/~kentda/ ]___/~
 ))\_student_/((  \__d L b__/  NTNU - graduate engineering - 4. year  )
( \__\_?|?_/__/ ) _)Industrial economics and technological management(
 \____/_?_\____/ (____engineering.discipline_=_Computer::Technology___)



Fri, 07 Jan 2005 18:28:02 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. multiple blocks or proc arguments to method

2. executing a proc passed as an argument?

3. Illogical proc argument binding

4. the proc argument to Marshal.load

5. Proc arguments in extensions

6. (newbie) calling a proc with a varying number of arguments

7. obtain values of arguments while renaming proc

8. Newbie: default argument on proc an env variable?

9. Generic Argument Parsing Proc

10. arrays as argument to a proc ?

11. proc argument and list

12. Called proc with to many arguments ?

 

 
Powered by phpBB® Forum Software