Re: What little functions/macros do you use?
Posted: Mon Mar 29, 2010 6:15 pm
So, and-let*, I presume as in http://srfi.schemers.org/srfi-2/srfi-2.html, cool, I get it, I'll try using it. Jasper, that seems like a nice implementation, except it can't handle non-variable/binding clauses.
I think the symbols named 'until and 'while might conflict, but you should be able to work around that if you really want, because neither loop nor iterate have function bindings for them.
) when I want to write some bits of array processing code in mathematical style, and since I don't have an editor that can do LaTeX style code rendering
, I'm pretty happy with things like this
. Having said that, perhaps they're not what you were looking for when you started the post
.
About def-setf-fun, I looked at it and went - cool! I think it's great for the simple case, like some other language's getters and setters, but I can't think of a situation when I want to put anything else in body (but that doesn't mean such situations don't exist).
):
Note that while could be replaced by until if that removes a not, it's also defined in both loop and iterate.
I think the symbols named 'until and 'while might conflict, but you should be able to work around that if you really want, because neither loop nor iterate have function bindings for them.
I think that they shine (true, my preferenceJasper wrote:There really isn't any source of confusion in how you arranged things in with-easy-arrays, just a little pet worry of mine. Sometimes it is just a personal preference, just like you liked 1ref, 1elt, don't think those personal preferences are very productive, by the way. It may be a distraction, especially in dealing with other people's code.




About def-setf-fun, I looked at it and went - cool! I think it's great for the simple case, like some other language's getters and setters, but I can't think of a situation when I want to put anything else in body (but that doesn't mean such situations don't exist).
I have got a while in my utilities file, but I rarely use it. For me it hasn't been fear, but just that loop and other tools do a better job, one way being to provide the 'state' variables to use destructively. So I use things that kindof look like (in a loose CLHS senseDolda wrote:And finally, how comes CL doesn't come with a built-in definition of WHILE?

Code: Select all
(loop [with state = blah] while condition do stuff do other-stuff)
;; or
(iter [(with state = blah)] (while condition) multiple forms to do stuff)