Re: More info on Rich Hickeys ideas on Map types from "Maybe Not"

2019-04-24 Thread Ben Sima
Henning Sato von Rosen writes: > Sorry if I'm wrong here, but I'm not sure we are talking about the same > data-type; I'm not referring to the Rich's examples with Maybe, but his > examples with records/maps, where some fields may or may not be present. Right, and in most other type systems, th

Re: More info on Rich Hickeys ideas on Map types from "Maybe Not"

2019-04-24 Thread Ben Sima
I guess I'll take a crack at this... I think generally, core.spec is an implementation of contracts, so you could look at the literature around contracts for some sources. Racket is (afaik) most integrated contract language, there are some references here to start with: https://docs.racket-lang.or

Re: Text replacement capability in clojure macros (just like C #define)

2019-02-01 Thread Ben Sima
f...@helpshift.com writes: > I want to write a macro > > (defmacro params [] 'a 'b 'c) > > that will be used in places like this > > ;; without macro > (fnc a b c) > > ;; with macro > (fnc pararms) => (fnc a b c) If you have a list of params, you can apply a function to it like so: