Hi,
Am 22.01.2009 um 18:25 schrieb David Nolen:
Can't some elements of the problem be solved with some form of
predicate dispatching as proposed by Meikel? Predicate dispatching
would allows us to use _anything_ as a type (i.e. structs
themselves), as well as allowing user defined functio
http://lispnyc.org/soc2009.clp
Forget most of what I said, it seems the BDFL already has these things in
mind ;) Enough of types and structs for me, time for me dive into the less
familiar territory of Clojure.
On Thu, Jan 22, 2009 at 12:25 PM, David Nolen wrote:
> Can't some elements of the pro
Can't some elements of the problem be solved with some form of predicate
dispatching as proposed by Meikel? Predicate dispatching would allows us to
use _anything_ as a type (i.e. structs themselves), as well as allowing user
defined functions to do the matching instead of being limited to isa? an
On 22.01.2009, at 15:26, Rich Hickey wrote:
> It's pretty easy to write a trivial struct system, much harder to
> address performance, interop, compilability, dynamicity etc
> constraints.
Indeed.
> As a simple case, if a defstruct is re-evaluated, will objects created
> after that be of the sa
On Jan 22, 2:48 am, Mark Engelberg wrote:
> Thanks for the thread links. This is basically what I suspected -- if
> you want to use structs in multimethods, you have to roll your own
> constructor which adds some kind of "type" tag to either the hashmap
> or the metadata.
>
> It just seems lik
On Jan 22, 4:46 am, Christophe Grand wrote:
> Konrad Hinsen a écrit :> there is nothing in the standard library to add a
> > tag to an existing metadata map. All there is is (with-meta ...),
> > which replaces the metadata map completely.
>
> It itched me before and since there's already alter-
On 22.01.2009, at 10:51, Konrad Hinsen wrote:
> At the end of this message is a simple illustration of what can be
> done with these changes. Any feedback is welcome of course!
Maybe I should reply immediately to some objections I expect to come:
1) Why create a secondary type system around str
On 22.01.2009, at 09:30, Konrad Hinsen wrote:
> Not that I know. I have been searching for a while, and ended up
> using my own tag attached to the struct as metadata. In clojure.zip
> there is a similar use of metadata: methods are implemented as
> functions passed in the metadata.
After a quick
Konrad Hinsen a écrit :
> there is nothing in the standard library to add a
> tag to an existing metadata map. All there is is (with-meta ...),
> which replaces the metadata map completely.
>
It itched me before and since there's already alter-meta! maybe there
should also be an alter-meta
>
> I am not entirely happy with this approach though. If everyone starts
> to use metadata for various purposes, such type tags may well
> disappear by some function replacing the metadata on an object
> without preserving the tags that are already there. This is all the
> more likely because ther
Finally started a GitHub repo just for this project.
http://github.com/swannodette/cljos/tree/master
The earlier version of course was very flawed/buggy. OK start, but the
macros in it were written with little/no understanding about how symbols are
resolved into their namespaces in Clojure (or Li
On 22.01.2009, at 07:48, Mark Engelberg wrote:
> Is there any way to determine whether something is a "struct" (versus
> an ordinary hash map), and if so, determine which kind of struct it
> was built from?
Not that I know. I have been searching for a while, and ended up
using my own tag attac
On Jan 21, 11:48 pm, Mark Engelberg wrote:
> Thanks for the thread links. This is basically what I suspected -- if
> you want to use structs in multimethods, you have to roll your own
> constructor which adds some kind of "type" tag to either the hashmap
> or the metadata.
>
> It just seems lik
Thanks for the thread links. This is basically what I suspected -- if
you want to use structs in multimethods, you have to roll your own
constructor which adds some kind of "type" tag to either the hashmap
or the metadata.
It just seems like a common case, so I was hoping there was a more
conven
On Jan 21, 10:48 pm, Mark Engelberg wrote:
> Is there any way to determine whether something is a "struct" (versus
> an ordinary hash map), and if so, determine which kind of struct it
> was built from?
P.S., for the first part, you can use
(instance? clojure.lang.PersistentStructMap x )
alt
I feel like I've seen an answer to this before, but I can't find the
specific thread now. However, the following two threads seem to have
very closely related info (including a reply or two from Rich).
http://groups.google.com/group/clojure/browse_thread/thread/a5e0ba6480d04829/e8e2a14c77f5babf?
16 matches
Mail list logo