Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
CLJ-957: Typehints for variadic methods in deftype fail to compile
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chris Gray  
View profile  
 More options Mar 22 2012, 6:40 pm
From: Chris Gray <chrismg...@gmail.com>
Date: Thu, 22 Mar 2012 16:40:28 -0600
Local: Thurs, Mar 22 2012 6:40 pm
Subject: CLJ-957: Typehints for variadic methods in deftype fail to compile
Hello,

I noticed that code like the following

(defprotocol ProtocolToTestMethodArgHints
  (method-with-multiple-sigs [this ^long arg1 ^boolean arg2] [this ^boolean arg1 ^boolean arg2 ^boolean arg3]))
(deftype TypeToTestMethodHints []
  ProtocolToTestMethodArgHints
  (method-with-multiple-sigs [this ^long arg1 ^boolean arg2] arg1)
  (method-with-multiple-sigs [this ^boolean arg1 ^boolean arg2 ^boolean arg3] arg2))

would cause the compiler to throw an exception.  (Basically because
defprotocol kept the typehints and deftype threw them away.)

I decided to fix it by having deftype keep the typehints.  I guess it
would also work if we had defprotocol throw them away.

Which solution is "right"?  Discuss! :)

Cheers,
Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Nolen  
View profile  
 More options Mar 22 2012, 7:17 pm
From: David Nolen <dnolen.li...@gmail.com>
Date: Thu, 22 Mar 2012 19:17:19 -0400
Local: Thurs, Mar 22 2012 7:17 pm
Subject: Re: CLJ-957: Typehints for variadic methods in deftype fail to compile

As far as I know, protocol methods are not meant to be hinted.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Gray  
View profile  
 More options Mar 22 2012, 8:04 pm
From: Chris Gray <chrismg...@gmail.com>
Date: Thu, 22 Mar 2012 18:04:54 -0600
Local: Thurs, Mar 22 2012 8:04 pm
Subject: Re: CLJ-957: Typehints for variadic methods in deftype fail to compile
So does that mean that you think the types on protocol methods should
be dropped?  Because I'm okay with that solution as well.  I prefer
the solution that I've posted because it is simple and works the same
way as typehints on regular functions, but if there's a good reason
not to allow hints on protocol methods, it shouldn't be too hard to
drop them.

Cheers,
Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Nolen  
View profile  
 More options Mar 23 2012, 12:59 am
From: David Nolen <dnolen.li...@gmail.com>
Date: Fri, 23 Mar 2012 00:59:11 -0400
Local: Fri, Mar 23 2012 12:59 am
Subject: Re: CLJ-957: Typehints for variadic methods in deftype fail to compile

primitive type-hints have no meaning on protocol fns - as in there is no
support at all for it to work. It would be nice to support class type-hints
tho.

David


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »