Hi,
On Jan 20, 11:10 pm, Bryce wrote:
> What am I missing?
Try ` instead of '. eval evaluates the expression with a different ns.
Since y is not properly quoted it is not found. ` will resolve y to
its qualified name and everything will work out.
Standard Disclaimer: this is only one subtle go
Hi,
> (defn y [a b] (+ a b))
> (def x '(y 1 2))
>
> (defn -main []
> (println (eval x)))
>
> which yields
>
> "Unable to resolve symbol: y in this context (NO_SOURCE_FILE:7)"
> etc.
> What am I missing?
The problem is namespace inside the function used by gen-class (and it
this case your -main
On Sep 4, 1:55 am, Miron Brezuleanu wrote:
> I'm not sure this is an interpreter/compiler issue :-) I think it is
> more of a resource allocation problem, i.e. what features to add to
> Clojure and when.
True, it's that Clojure does not have first-class environments, either
dynamic or lexical.
On 4 Sep 2009, at 07:04, Stuart Sierra wrote:
> Or, more simply, Python is an interpreter, Clojure is a compiler. So
> Clojure's "eval" actually compiles the form into Java bytecode, then
> executes it.
I'd say both Python and Clojure are somewhere in between the classical
extremes of "interp
Hello,
On Fri, Sep 4, 2009 at 8:04 AM, Stuart
Sierra wrote:
>
> On Sep 3, 9:26 am, Konrad Hinsen wrote:
>> I don't think so. Python and Clojure are quite different languages.
>> Python is much more dynamic, with variable lookup happening at
>> runtime.
>
> Or, more simply, Python is an interpret
Hello,
On Fri, Sep 4, 2009 at 4:01 AM, James Sofra wrote:
>
> Hi,
>
> I am not familiar with the Python code.interact() thing and what it
> does so I may be missing something but if you are looking to do
> debugging is there a reason you can't use a Java debugger to debug
> your Clojure code? (I
On Sep 3, 9:26 am, Konrad Hinsen wrote:
> I don't think so. Python and Clojure are quite different languages.
> Python is much more dynamic, with variable lookup happening at
> runtime.
Or, more simply, Python is an interpreter, Clojure is a compiler. So
Clojure's "eval" actually compiles t
Hi,
I am not familiar with the Python code.interact() thing and what it
does so I may be missing something but if you are looking to do
debugging is there a reason you can't use a Java debugger to debug
your Clojure code? (I have heard some people have had success for
JSwat.) I guess that is not
Hi,
On Thu, Sep 3, 2009 at 4:26 PM, Konrad Hinsen wrote:
>
> On 3 Sep 2009, at 14:43, Miron Brezuleanu wrote:
>
>> Is there a way to get the list of symbols bound locally and to access
>> their values?
>
> I don't think so. Python and Clojure are quite different languages.
> Python is much more d
On 3 Sep 2009, at 14:43, Miron Brezuleanu wrote:
> Is there a way to get the list of symbols bound locally and to access
> their values?
I don't think so. Python and Clojure are quite different languages.
Python is much more dynamic, with variable lookup happening at
runtime. In Clojure, onl
Hello,
thanks everyone for replies,
On Thu, Sep 3, 2009 at 2:36 PM, Konrad Hinsen
wrote:
>
> On 3 Sep 2009, at 08:24, Miron Brezuleanu wrote:
>
> > user=> (let [x 1] (eval '(inc x)))
> > java.lang.Exception: Unable to resolve symbol: x in this context
> > (NO_SOURCE_FILE:1)
> >
> > (on a freshl
On 3 Sep 2009, at 08:24, Miron Brezuleanu wrote:
> user=> (let [x 1] (eval '(inc x)))
> java.lang.Exception: Unable to resolve symbol: x in this context
> (NO_SOURCE_FILE:1)
>
> (on a freshly downloaded&compiled clojure from github)
>
> According to my understanding of http://clojure.org/evaluati
On Sep 3, 9:24 am, Miron Brezuleanu wrote:
> Hello,
>
> I'm a Clojure newbie (many thanks to Rich Hickey and everyone involved
> - it's a great programming environment) and I have some trouble with
> 'eval'.
>
> What I'm trying is:
> $ java -cp clojure.jar clojure.lang.Repl
> Clojure 1.1.0-alpha-
You need to unquote the x to get its value from the let. You can do
that with the tilde character inside syntax quotes:
user=> (let [x 1] (eval `(inc ~x)))
2
On Thu, Sep 3, 2009 at 8:24 AM, Miron Brezuleanu wrote:
>
> Hello,
>
> I'm a Clojure newbie (many thanks to Rich Hickey and everyone invol
14 matches
Mail list logo