You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of #37 we now have contains?, array-contains?, string-contains?.
I see a few ways of handling this:
don't, many lisps never handle this, so leave it be.
have the contains? method test it's argument and dispatch to list-contains?, array-contains?, string-contains? - this works for builtin types but cannot be user extended.
have contains operate via an interface that supports all the builtin types that can also be extended - I am unsure if Carp currently has the capability for this.
What are your thoughts?
The text was updated successfully, but these errors were encountered:
hmm on second-thought maybe option (2) is actually user-extendible if functions/macros are powerful enough
maybe (contains? foo) could dispatch to (typeof(foo)-contains? foo)
this would require something being able to get a typeof string, append "-contains?" (or arbitrary function names) and then call it (via eval I presume?)
Yes, this is very interesting. My hope is to implement something like this eventually, and your solution is nice and simple. The first 0.1 release of carp won't have it though, I want to sort out some bigger things (like modules) first!
As of #37 we now have
contains?
,array-contains?
,string-contains?
.I see a few ways of handling this:
contains?
method test it's argument and dispatch tolist-contains?
,array-contains?
,string-contains?
- this works for builtin types but cannot be user extended.contains
operate via an interface that supports all the builtin types that can also be extended - I am unsure if Carp currently has the capability for this.What are your thoughts?
The text was updated successfully, but these errors were encountered: