Fork me on GitHub
#clojure
<
2017-10-21
>
devn02:10:53

Interesting note is that in CL I believe they suggest using when for situations where the body has side effects, preferring an if that returns a value in the else case.

devn02:10:22

explicit > implicit rides again

devn02:10:19

Though I suppose you could make the argument they’re equivalently implicit and tribal

lmergen06:10:50

i'm trying to find a library that provides some higher-level constructs on top of core.test that allows me to work with collections. a bit like midje's utilities, but without midje and preferably macro-free. is there anything like that out there ?

dominicm06:10:22

@lmergen expectations has some things that sound like what you're after.

lmergen06:10:44

@dominicm thanks, let me check!

dominicm06:10:05

There's also https://github.com/metosin/testit which I found a little while ago

lmergen06:10:25

expectations is exactly what i'm looking for!

lmergen06:10:53

thanks 🙂

lmergen07:10:10

so many things in there i didn't even know i needed

matthew.gretton19:10:00

@noisesmith I’m using pre-walk exactly as you describe currently. I’ll take a look at clojure bots, and jailing of execution context. I was thinking that a lot of the interactive clojure tutorials must do something like this. E.g. http://www.tryclj.com/. Thanks for the reply.

noisesmith19:10:47

specific github things to check out would be clojurebot, lazybot, and clojail

matthew.gretton19:10:03

Thanks. I’ll take a look.

matthew.gretton19:10:05

In fact, clojail is used in try clojure!

mingp19:10:45

@matthew.gretton If you are looking to do whitelist-based validation for syntax and symbols, you have to be extremely careful what you allow into the whitelist. For example, see Swearjure (http://hypirion.com/musings/swearjure).

mingp19:10:30

The advantage of having a separate DSL and a separate interpreter is that you explicitly constrain the bounds of the DSL up front, and it's harder to get surprised by something in the language that you weren't aware of or didn't anticipate before.

matthew.gretton22:10:16

@mingp - Thanks for linking the swearjure article. I can see it’s possible to build up a large number of complex functions from simple building blocks. However, I don’t think I would whitelist any functions that actually have side effects. Assuming this was stuck to I think we would be ok. Your point is entirely valid however as the introduction of a function that actually changes things could open the door to a range of other functions. Thanks for the reply.