Re: Prismatic Schema - Self-reference in schema definitions

2016-03-12 Thread JvJ
Thanks for the tip here. abstract-map-schema works really well. One thing that I would add to it if I could would be a dispatch function rather than just keywords, but I don't need that at the moment. On Sunday, 6 March 2016 18:41:53 UTC-8, Jason Wolfe wrote: > > If I'm understanding correctly,

Re: Prismatic Schema - Self-reference in schema definitions

2016-03-06 Thread Jason Wolfe
If I'm understanding correctly, this sounds like a `schema.experimental.abstract-map-schema` to me (it's basically shorthand for what Bobby suggests) . There's an example in the readme. Best, Jason On Sunday, March 6, 2016 at 5:28:31 AM UTC+5:30, JvJ wrote: > > I've been using Schema, and the

Re: Prismatic Schema - Self-reference in schema definitions

2016-03-05 Thread JvJ
Algebraic data types are exactly what I'm looking for, actually. I think I'll try something like that. On Saturday, 5 March 2016 16:28:22 UTC-8, Bobby Eickhoff wrote: > > Note also that I'm giving each Zone "object" it's own :type property. > That's how I'm able to dispatch on the type. It al

Re: Prismatic Schema - Self-reference in schema definitions

2016-03-05 Thread Bobby Eickhoff
Note also that I'm giving each Zone "object" it's own :type property. That's how I'm able to dispatch on the type. It also plays well with multimethods. On Saturday, March 5, 2016 at 7:26:27 PM UTC-5, Bobby Eickhoff wrote: > > It sounds like what you're describing is (structurally) an algebrai

Re: Prismatic Schema - Self-reference in schema definitions

2016-03-05 Thread Bobby Eickhoff
It sounds like what you're describing is (structurally) an algebraic data type, i.e. a generic type with specific variants. I've been able to do something like this in my own projects. Here I'm considering Zone the general type and each variant is Zone:Hand, Zone:Deck, &c. (def Zone:Hand ..

Prismatic Schema - Self-reference in schema definitions

2016-03-05 Thread JvJ
I've been using Schema, and there's a kind of type definition that I'm having trouble with. I'm not sure exactly how to describe it, so I'll provide an example. I'm working on a digital card game in which there are numerous zones that a card may be in. Each card needs to know which zone it is

Prismatic Schema - Self-reference in schema definitions

2016-03-05 Thread JvJ
I've been using Schema, and there's a kind of type definition that I'm having trouble with. I'm not sure exactly how to describe it, so I'll provide an example. I'm working on a digital card game in which there are numerous zones that a card may be in. Each card needs to know which zone it i