On Nov 23, 4:03 am, Meikel Brandmeyer <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Am 23.11.2008 um 02:29 schrieb James Reeves:
>
> >> (defn make-person [name age]
> >> (assoc (struct person name age person) :type person))
>
> > Maybe you could roll this into a macro:
>
> > (defmacro struct*
> > [type
Hi,
Am 23.11.2008 um 02:29 schrieb James Reeves:
(defn make-person [name age]
(assoc (struct person name age person) :type person))
Maybe you could roll this into a macro:
(defmacro struct*
[type & params]
`(assoc (struct ~type [EMAIL PROTECTED]) :type ~type))
Why? A function does the sam
On Nov 22, 10:08 pm, André Thieme <[EMAIL PROTECTED]> wrote:
> (defstruct person :name :age)
>
> (defn make-person [name age]
> (assoc (struct person name age person) :type person))
Maybe you could roll this into a macro:
(defmacro struct*
[type & params]
`(assoc (struct ~type [EMAIL PROTE
On 14 Nov., 20:11, Jeff Rose <[EMAIL PROTECTED]> wrote:
> Hi,
> I'm working on a library where I'd like to be able to dispatch off of
> whether the arguments are one of a number of different possible structs.
> I've created a custom hierarchy and everything makes sense with derive
> etc., but
On Nov 14, 3:42 pm, Chouser <[EMAIL PROTECTED]> wrote:
> On Fri, Nov 14, 2008 at 2:11 PM, Jeff Rose <[EMAIL PROTECTED]> wrote:
> > Does my dispatch function have to inspect the passed in values to
> > figure out which type of struct they are, or can I query that
> > somehow?
>
> My understanding i
Hi Steve,
Metadata is data that does not contribute to an equality relationship.
In most scenarios different types are considered not equal, and so
should be modelled as data.
Stuart
>
> On Nov 14, 3:42 pm, Chouser <[EMAIL PROTECTED]> wrote:
>> On Fri, Nov 14, 2008 at 2:11 PM, Jeff Rose <[
On Nov 14, 3:42 pm, Chouser <[EMAIL PROTECTED]> wrote:
> On Fri, Nov 14, 2008 at 2:11 PM, Jeff Rose <[EMAIL PROTECTED]> wrote:
> > Does my dispatch function have to inspect the passed in values to
> > figure out whichtypeof struct they are, or can I query that
> > somehow?
>
> My understanding is
I wonder if it would good to have something indicating the struct name
put in the metadata when creating a struct?
On Fri, Nov 14, 2008 at 1:42 PM, Chouser <[EMAIL PROTECTED]> wrote:
>
> On Fri, Nov 14, 2008 at 2:11 PM, Jeff Rose <[EMAIL PROTECTED]> wrote:
> > Does my dispatch function have to in
On Fri, Nov 14, 2008 at 2:11 PM, Jeff Rose <[EMAIL PROTECTED]> wrote:
> Does my dispatch function have to inspect the passed in values to
> figure out which type of struct they are, or can I query that
> somehow?
My understanding is that StructMaps are just Maps with an
implementation that's opti
Hi,
I'm working on a library where I'd like to be able to dispatch off of
whether the arguments are one of a number of different possible structs.
I've created a custom hierarchy and everything makes sense with derive
etc., but I don't understand how I convert from input values to the
sym
10 matches
Mail list logo