Re: How would you spec deref-ables?

2016-10-29 Thread Timothy Baldridge
I would stop the specing at the boundary of a IDeref. For example you can say "this function takes a integer and returns a instance of IDeref". Digging into the details of that object isn't something I would try to spec. Beyond that I would probably try to write functions that take data and retur

Re: How would you spec deref-ables?

2016-10-29 Thread Mohammad Sadeq Khoeini
Correct. However I'd like to use documentation and generative abilities of clojure.spec. I could directly deref inside my functions and then everything would work nicely. However, That would raise efficiency concerns. I would say in my case derefing doesn't cause a huge problem, and writing som

Re: [ANN] Nightlight, an embedded editor for Clojure

2016-10-29 Thread Zach Oakes
Yep I definitely plan on adding that feature. For now, you'll just have to refresh your browser =) By the way, I just released version 1.1.0, which adds some initial support for ClojureScript! I added a new section on the website that explains how to set it up. On Saturday, October 29, 2016 at

Re: How would you spec deref-ables?

2016-10-29 Thread Timothy Baldridge
Specs are for checking the shape of data. "deferreds" are not data, they are opaque objects. So in short the answer is "you can't" or more correctly: you may be able to, but shouldn't. One of the problems with even trying to spec something like IDeref is that the very act of observing it may have

How would you spec deref-ables?

2016-10-29 Thread Mohammad Sadeq Khoeini
I'm trying to write a wrapper for telegram api[1]. Responses from the api are either successful, which would then have a `{"ok": true, result: ...}` shape, or error with the shape of `{"ok": false, description: "..."}`. Also, I'm using aleph to call the api. So, the responses are deferreds [2].

Can clojure.spec be used to identify/pinpoint broken invariants on dynamic data?

2016-10-29 Thread Yannick Scherer
First off, this is basically a follow-up to my previous question . I fear I didn't express my concerns clearly so it was very hard to answer the underlying questions. *The Spec* Let's say we have a spec, describing the AST for a very

Re: with-redefs does not work for macros

2016-10-29 Thread Tiago Espinha
Damn it, I got exactly the same thing. In my case when trying to mock the /error fun...ehem...macro :-) There should definitely be some kind of warning or even an error. It doesn't make sense to mock macros since these are expanded at compile time. On Monday, April 27, 2015 at 8:03:43 PM UTC+2,

Re: "Dynamic" and Spezialised Specs (clojure.spec)

2016-10-29 Thread Yannick Scherer
> > Spec forms are data and can be conformed against s/form specs (not yet > released) to produce more map-like data suitable for driving data > generation if you like. Could you expand on that? Can this be used to generate specs data can be conformed against without having to alter the globa

Re: [ANN] Nightlight, an embedded editor for Clojure

2016-10-29 Thread ru
Great work, Zach! Thank you. I would like to switch from Lifhttable+Terminal working environment that I use now, to Nightlight. But I definitely need "Refresh folder" and/or "Refresh file" actions, because sometimes I update source files from outside of a project. Is it possible to add someth