I investigated a few of these. Variable arity functions don't some to work, 
but destructuring and parameter number seem unaffected.

https://gist.github.com/johnwalker/8151474

I suspect that what I wrote below is possible with multimethods.

(defrecord foobarrecord
    foobarprotocol
    :declare foo)

(defn :foobarrecord foo [...] ...)

This is an excellent issue you've brought up.

On Friday, December 27, 2013 2:14:54 PM UTC-5, puzzler wrote:
>
> The thing I like about your record/protocol example version is that all 
> the protocol function implementations can "see" the components of the 
> record and use those names in the implementation without explicit 
> destructuring.  That adds significantly to the ease of working with 
> multiple functions sharing common information.
>
> I generally haven't been able to do this kind of thing because:
> 1. The implementations of the functions are too long to implement inline 
> in the record definition.
> 2. Protocols are significantly more restricted than regular functions 
> (e.g., aren't they restricted to 4 parameters, no indefinite arities, and 
> no destructuring in the arguments?)
>
>
> On Fri, Dec 27, 2013 at 10:19 AM, john walker 
> <[email protected]<javascript:>
> > wrote:
>
>> I posted this in response to the original gist, but it probably wasn't 
>> seen. Does this demonstrate the behavior you want?
>>
>> https://gist.github.com/johnwalker/8142143
>>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to