LoginSignup
1
0

More than 5 years have passed since last update.

protocolで可変個引数は取れない

Last updated at Posted at 2012-03-16
(defn f [x & xs] (apply some-function x xs))

みたいにprotocolで可変個引数(variadic arity)は取れない。

(defprotocol foo
  (bar [f])
  (baz [f & gs]))

protocolは低レベルな仕組みの提供を目的としているかららしい。

Do clojure protocols allow one to have a variadic method the way funcions do (with an ampersand)? - Stack Overflow

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0