[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C++ declaration style programming?
From: |
Thien-Thi Nguyen |
Subject: |
Re: C++ declaration style programming? |
Date: |
Thu, 22 Jan 2004 03:24:46 +0100 |
From: Viktor Pavlenko <address@hidden>
Date: Wed, 21 Jan 2004 10:41:09 -0500
Using side effects to re-bind a variable within the binding
expression of let* sounds like cheating :)
well, here's another way to "cheat", i suppose:
(defmacro let-false (bindings . body)
`(let ,(map (lambda (b) (list b #f)) bindings) ,@body))
usage is something like:
(let-false (a b c) 1) => 1
(let-false (a b c) b) => #f
(let-false (a b c)
(set! a 2)
(set! b (+ a (* a a)))
(set! a (+ b (* b b)))
(list a (not c))) => the answer to life the universe and everything?
(let-false (a b c) d)
=| ERROR: Unbound variable: d
ABORT: (unbound-variable)
if "false" is too much of a downer, you can munge to taste of course.
"let-pessimistic", "let-oh-why-bother-i-have-a-brain-the-size-of-a-planet".
thi
- Re: C++ declaration style programming?, (continued)
- Re: C++ declaration style programming?, Issac Trotts, 2004/01/20
- Re: C++ declaration style programming?, Lynn Winebarger, 2004/01/21
- Re: C++ declaration style programming?, Stephen Compall, 2004/01/21
- Re: C++ declaration style programming?, Keith Wright, 2004/01/21
- Re: C++ declaration style programming?, Viktor Pavlenko, 2004/01/21
- Re: C++ declaration style programming?, Viktor Pavlenko, 2004/01/21