Re: Using a function to def other functions?

2016-08-08 Thread Andrew C
I don't understand -- How am I using 'def' in a non-top-level-form? I thought I was calling 'bar', getting the result which is a function, and binding that function to a name 'foo', where the binding is 'def' at the top level. Is that not what I'm doing? I'm trying to avoid the use of unnecess

Re: cautious wrapper for letfn that does macroexpansion on fnspecs first

2016-08-01 Thread Andrew C
In case anyone's curious, It was a bad idea :) It compiled and seemed to work fine until it tried to return a result and instead evaluated (result). There was a way to fix it where my letfn' macro dealt with the name and body separately. But I ended up defining functions on their own and using

cautious wrapper for letfn that does macroexpansion on fnspecs first

2016-07-27 Thread Andrew C
letfn assumes fnspecs are all already properly shaped, like: (fn-name [args] body) But it is possible that a macroexpansion is needed to get them in the right shape before letfn does its work, especially if the user found all his fnspecs were of similar shape and used a macro to eliminate boile

Automat - order of reducing functions?

2016-07-22 Thread Andrew C
How come the order of the reducing operations in the resulting diagrams below is different? Basically I want to call the first reducing operation after the first 1 and then the second operation when it accepts. This is with [org.clojars.semperos/automat "0.2.0-alpha3"] (ns p.core (:require [