Re: Ring, redirect with flash

2017-09-13 Thread James Reeves
You haven't included the code where the flash and session middleware are applied to the handler, or the handler that consumes the flash message. On 14 September 2017 at 02:31, Luis Medina wrote: > Hello to everybody! > > I'm pretty new in clojure, i trying to figure out how to redirect to > anot

RE: [ANN] Clojure 1.9.0-alpha20

2017-09-13 Thread Sean Corfield
We put it in production on Monday. So far, so good. Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood From: Sean Corfield Sent: Thursday, September 7, 2017 5:56 PM To: cloju

RE: Ring, redirect with flash

2017-09-13 Thread Sean Corfield
Do you have the wrap-flash middleware in place? Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood From: Luis Medina Sent: Wednesday, September 13, 2017 6:49 PM To: Clojure S

Re: using clojure spec for dispatching on different map structures

2017-09-13 Thread Didier
I'm not following 100%. But s/or of specs will comform to the first valid spec it encounters. It can be used for duck typing, aka, strutural types. So given you have many maps, each can be a spec. Then you can create a spec which is one of these shapes of maps. Pass any map to the or spec, and i

Ring, redirect with flash

2017-09-13 Thread Luis Medina
Hello to everybody! I'm pretty new in clojure, i trying to figure out how to redirect to another page with a flash value with a error message, could be something easy but i don't understood how to make that. Session it's relatibely fine, but flash it's empty every time. It's really dificult to

Re: using clojure spec for dispatching on different map structures

2017-09-13 Thread Alex Miller
I don't see any benefit of using a subset of spec to do this - why not just use normal Clojure code on sets of keys? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from ne

Re: using clojure spec for dispatching on different map structures

2017-09-13 Thread Brent Millare
Yeah, that's what I thought. I guess I'm using it in a way that's not standard practice. Luckily it's not a bottleneck in my case. Has there been discussion about a "shortable" version of s/keys which just checks for key existence and doesn't recursively validate the corresponding values? I su

Re: Webassembly as a Clojure target platform

2017-09-13 Thread Hlöðver Sigurðsson
https://github.com/AssemblyScript/assemblyscript Looks like the Typescript people are attempting exactly this. On Monday, 4 April 2016 08:50:06 UTC+2, JvJ wrote: > > Is there any plan in the future to have clojure (or some dialect of > clojure) compile to webassembly? I can't say for sure if i

Re: using clojure spec for dispatching on different map structures

2017-09-13 Thread Alex Miller
Seems pretty slow to dispatch on a linear series of spec validations, but I don't see any reason it wouldn't work. On Wednesday, September 13, 2017 at 3:47:40 PM UTC-5, Brent Millare wrote: > > The example for multi-spec provided in the spec guide assumes a key that > denotes a "type". (This key

Re: using clojure spec for dispatching on different map structures

2017-09-13 Thread Brent Millare
The example for multi-spec provided in the spec guide assumes a key that denotes a "type". (This key is used as the dispatch fn). In my situation, I'm assuming I don't have control over what maps are generated. In other words, I explicitly do not want to have to encode types into the input map.

Re: using clojure spec for dispatching on different map structures

2017-09-13 Thread Alex Miller
You might want to look at s/multi-spec which lets you create a variable open spec based on a multimethod, which would in this case be based on key availability. On Wednesday, September 13, 2017 at 11:54:31 AM UTC-5, Brent Millare wrote: > > I have several maps with different combinations of key

using clojure spec for dispatching on different map structures

2017-09-13 Thread Brent Millare
I have several maps with different combinations of keys for each map. I want to process each map but do different work depending on the set of keys available, basically dispatch on key availability. I thought clojure.spec might be a good fit for doing the classification step. So for each key, I