KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Considered that I have a procedure (plus x y) witch takes exactly two args. And now I also have a list which contains two objects like (list 1 2) . So, if there's any magic way to expand the list as two arguments. We have a dot notion version, but that isn't what i want. I just want to expand the list to make Scheme believe I passed two arguments instead of a list. Hope those Ruby codes help: a = [1, 2] def plus(x,y); x+y; end plus(*a) # See that a is an array and the plus method requires # exactly two arguments, so we use a star operator to # expand the a as arguments
Tags (comma-separated)
Save Edits
Cancel