Is 'declare' possibly the missing component here?
On Dec 14, 3:37 pm, Razvan Rotaru razvan.rot...@gmail.com wrote:
Yes. Assuming I have following macros:
(button :id b1 :listener #(...)) = (let [b1 (new JButton)] ...)
(panel [:id p1] (button :id b1 ...) (button :id b2 ...)) = (let [p1
(new
'declare' wouldn't be good because of the scope of vars. There's no sense
using global (albeit namespaced) variables for what probably only need to
be local identifiers.
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send
Hi,
to implement letrec in a language with eager evaluation strategy some
kind of mutability is probably needed. Consider for example a self-
referential definition such as
(let [fibo (lazy-cat [1 1] (map + fibo (rest fibo)))]
(take 10 fibo))
This will not work since fibo is not in scope when
Hi,
you'll probably have to rewrite your panel macro, so that it recognizes the
button (and label, etc) macros ((= #'button (resolve env sym)) in 1.3) and
extracts the ids from the subform. Then you construct a global let which
contains all the individual id namings. Then you group all '...'
Hi,
if you always follow the let structure you outlined the following might work.
Untested, though. Note, that things work recursively with this approach.
(def ours? #{#'button #'label ...})
(defmacro panel
[{:keys [id]} components]
(let [[bindings body]
(reduce (fn [[bindings
lazy-seq and letfn should cover anything you would need letrec for
On Wed, Dec 14, 2011 at 11:09 AM, Razvan Rotaru razvan.rot...@gmail.com wrote:
Hi,
Is there a reliable implementation of letrec in clojure? Anybody using
it?
I have found a post from 2008, with an implementation which I don't
I don't quite understand why people are saying this. Anyway, It's not
enough for me.
On Dec 14, 9:13 pm, Kevin Downey redc...@gmail.com wrote:
lazy-seq and letfn should cover anything you would need letrec for
On Wed, Dec 14, 2011 at 11:09 AM, Razvan Rotaru razvan.rot...@gmail.com
On Wed, Dec 14, 2011 at 2:53 PM, Razvan Rotaru razvan.rot...@gmail.comwrote:
I don't quite understand why people are saying this. Anyway, It's not
enough for me.
What can't you solve your problem with what was suggested?
David
--
You received this message because you are subscribed to the
letfn defines functions. I'm just defining some values. The values
contain anonymous functions which need to refer to other values.I know
there are workarounds for this, but this means I must change the
interface.
Razvan
On Dec 14, 9:56 pm, David Nolen dnolen.li...@gmail.com wrote:
On Wed, Dec
Do you have a minimal example of what you are trying to do?
On Wed, Dec 14, 2011 at 3:53 PM, Razvan Rotaru razvan.rot...@gmail.comwrote:
letfn defines functions. I'm just defining some values. The values
contain anonymous functions which need to refer to other values.I know
there are
Yes. Assuming I have following macros:
(button :id b1 :listener #(...)) = (let [b1 (new JButton)] ...)
(panel [:id p1] (button :id b1 ...) (button :id b2 ...)) = (let [p1
(new JPanel) b1 (button :id b1 ...) b2 (button :id b2 ...)] ...)
How to make the listener in b1 refer to b2?
Razvan
On Dec
11 matches
Mail list logo