Fork me on GitHub

using plumatic schema, is it possible to extend a schema? If you have BaseSchema , can i have ChildSchema1 and ChildSchema2 extend BaseSchema, and add values on to it?


you can use a map from key to validator as a schema, and if you do that you can make a new schema using assoc or merge


most people have migrated from schema to spec.alpha (where deriving schemas works much differently)


yeah, but there really appears to be a dearth of compojure-api examples with spec. schema (so far) is really quite a bit easier to deal with.


i will take another look at it, though


@U0G2E3SEM we use schema quite a bit, and use, which has merge, assoc, etc functions for combining and modifying schemas


howwwwwwwwwww did i miss that - i use schema-tools too


:thumbsup: glad to help


(apply brain problems)


Does anyone have any tips for reading/cleaning up runtime error messages in Chrome DevTools? This is the kind of thing I see with pretty much every error. I've highlighted the only line that contains a reference to my own source code.


these seem quite easy to read? - no cofx handler registered for last-time - no subscription for :viewing-project - no way to deref null at views.cljs at line 123


Part of me wants to be able to turn off any references to files that I didn't write myself. It feels "below my layer of abstraction" to be looking at references to code in the cljs runtime.


Thanks @dpsutton, I personally find it quite frustrating compared to errors in other languages like Python and Elm... particularly when there are multiple runtime errors and the DevTools console literally explodes with them. I also wish I could somehow see these errors in Emacs/CIDER instead of having to constantly change focus to the DevTools panel when something doesn't look right in the my web app.


But if this looks normal to you, I'll get used it. I was wondering I was doing something wrong with configuring source maps or something.


a benefit but also a price of clj / cljs is being "close to the host", that leads to leaked abstractions but it also leads to a lot of power


it would certainly be possible to improve tooling like emacs/cider to include the errors in the editor, but I think it's generally been easier to make UI in the browser than in emacs/cider.


I'm thinking about introducing spec into my workflow to help pinpoint the simplest errors I make (usually passing the wrong type into a function that expects a map or sequence, etc). Where should a total beginner start with spec? Is Spec2 best practice?


Spec 2 isn't ready for use yet (it will ultimately become just clojure.spec) so clojure.spec.alpha is "best practice" for now.


That said, Spec 2's wiki and are good reading insofar as understanding how thinking around Spec has evolved and where it is going.


You may find this blog post helpful for insight into the various ways that Spec can help you @neil.hansen.31


And the official documentation: (rationale) and (guide).


One thing I will say as a caution: Spec is not a type system and you'll find it hard work if you try to use it like one. It's great for checking things at boundaries, such as APIs, but it's not really intended to be used "everywhere" (i.e., on every function).


Hey folks, I am looking at the guide on As shown below, I am wondering why (.close browser) doesn't get wrapped with . Thanks!

Drew Verlee22:08:30

Because regardless of the what happens in try, we want to close the browser next.

馃憤 3
Karol W贸jcik12:08:34

Clojurescript docs are wrong in that particular case. There should be <p!. Promise should be resolved to value. Otherwise you have Promise which is wrapped by chan.