Arc Forumnew | comments | leaders | submitlogin
1 point by skenney26 6066 days ago | link | parent

defcall looks interesting. Is there any documentation on other uses of it?

I like the idea of using the .. syntax:

  (spaces:map sq 1..5)


4 points by absz 6066 days ago | link

defcall is pretty simple to use. The syntax is the same as that of def, except instead of a function name, you provide the type of the object. The function receives both the objects and its "arguments". E.g.

  arc> (defcall sym (self n)
         (repeat n (prn self))
  #<procedure>
  arc> ('a 3)
  a
  a
  a
  nil

.

-----