Re: clojure and emacs. again.

2010-04-02 Thread Phil Hagelberg
On Fri, Apr 2, 2010 at 12:19 PM, jney wrote: >  I'm a newbie in clojure and in emacs too. I got this message error > while launching Slime : > > Debugger entered--Lisp error: (file-error "Searching for program" "No > such file or directory" "lisp") Slime is configured to use Common Lisp rather th

Re: REPL and its command prompt

2010-04-02 Thread Per Vognsen
Well, while I don't like it much, there are in fact REPLs that work the way he expects, e.g. SBCL's: This is SBCL 1.0.24, an implementation of ANSI Common Lisp. More information about SBCL is available at . SBCL is free software, provided as is, with absolutely no warranty.

Re: "," is REAL whitespace...

2010-04-02 Thread Frank Siebenlist
On Apr 2, 2010, at 7:14 PM, Armando Blancas wrote: >> So, it's all some form of RTFM... but one could argue that this novel use of >> commas in the syntax results in adding a little "incidental complexity" to >> the language ;-) > My wrong assumption was: "whitespace and commas are separators

Re: REPL and its command prompt

2010-04-02 Thread Armando Blancas
It's clear that a REPL used interactively must respond as it does, otherwise it's appear hanged. Do you have a particular scenario for your code? I thought about recreating or documenting a session, but you can't see the input, only the REPL's output. On Apr 2, 12:23 am, Michael Jaaka wrote: > Hi

Re: Leiningen integration?

2010-04-02 Thread Antony Blakey
I'm working on Clojure support for polyglot maven, and I anticipate publishing an initial feature-complete 100%-of-Maven version today. It not only reads/writes a programatic format like this: (defmaven 'org.clojure/clojure "1.2.0-master-SNAPSHOT" :model-version "4.0.0" :name "Lamdras Website"

Re: "," is REAL whitespace...

2010-04-02 Thread Armando Blancas
> So, it's all some form of RTFM... but one could argue that this novel use of > commas in the syntax results in adding a little "incidental complexity" to > the language ;-) You put some pretty specific assumptions into your code: commas as separators, commas with a "proper" place in Clojure sy

Re: Getting started embedding Clojure into an existing codebase

2010-04-02 Thread Josh Daghlian
On Apr 2, 9:24 am, Chas Emerick wrote: > But: invoking clojure.main.main programmatically?  Ouch. :-) > > - Chas Yeah, I know it's shady, and I know that with more time and effort I can avoid doing it, but should I bother? It's given me a command shell with access to my JPA layer that's been wor

clojure and emacs. again.

2010-04-02 Thread jney
Hello, I'm a newbie in clojure and in emacs too. I got this message error while launching Slime : Debugger entered--Lisp error: (file-error "Searching for program" "No such file or directory" "lisp") start-process("inferior-lisp" # "lisp") apply(start-process "inferior-lisp" # "lisp" nil)

holding types or units in metadata vs pattern matching

2010-04-02 Thread strattonbrazil
What's the best way to keep track of what kind of value something is? For example, if I have a hash of floats and I want to go through each one and see if a given key-value, which happens to be a float, if it's a distance or a frequency? Or if something is a struct or a specific struct? I'm somew

Re: Newbie question re. calling Java from Clojure

2010-04-02 Thread Michael Wood
On 2 April 2010 15:00, Kevin wrote: >> Here's my best attempt so far: >> >> -- >> (ns piccoloHello >>  (:gen-class) >>  (:import (edu.umd.cs.piccolo PCanvas PNode PLayer) >>    (edu.umd.cs.piccolo.nodes PText) >>    (edu.umd.cs.piccolox PFrame)))

Re: "," is REAL whitespace...

2010-04-02 Thread Frank Siebenlist
I did not want to argue for or against the "," as whitespace feature, but just wanted to point out the possible gotchas that we probably should warn novice clojure programmers for. I actually hit my head when I was trying to initialize a map with some nil value for :b, like: user> {:a, "a", :b,

Re: How to return a number from a deftype method?

2010-04-02 Thread David Nolen
On Fri, Apr 2, 2010 at 10:48 AM, Konrad Hinsen wrote: > On 02.04.2010, at 15:48, David Nolen wrote: > > > http://gist.github.com/353121 > > > > I'm unsure how to return a number. When I try to call the length-squared > method of my vec2 instance I get a very strange exception. Any help or > insigh

Re: How to return a number from a deftype method?

2010-04-02 Thread Konrad Hinsen
On 02.04.2010, at 15:48, David Nolen wrote: > http://gist.github.com/353121 > > I'm unsure how to return a number. When I try to call the length-squared > method of my vec2 instance I get a very strange exception. Any help or > insight much appreciated. Your code works fine for me, the value o

Re: "," is REAL whitespace...

2010-04-02 Thread Per Vognsen
Well, for the comma to be useful, it cannot require whitespace separation on either side. It would be weird if you had to write [1 , 2 , 3]. So, it shouldn't be surprising that 'list,' is read as 'list' when '123,' is read as '123'. Regarding the strangeness of comma-as-whitespace if you're coming

Re: characters permitted in symbols??

2010-04-02 Thread Douglas Philips
On 2010 Apr 1, at 12:56 PM, Stuart Halloway wrote: I think you are reading this backwards. Nothing will be removed from the list, things won't become more limiting. The lack of guarantee is around the addition of new features. :) Clojure is remarkably stable. The ecosystem of libraries arou

How to return a number from a deftype method?

2010-04-02 Thread David Nolen
http://gist.github.com/353121 I'm unsure how to return a number. When I try to call the length-squared method of my vec2 instance I get a very strange exception. Any help or insight much appreciated. David -- You received this message because you are subscribed to the Google Groups "Clojure" gr

Re: characters permitted in symbols??

2010-04-02 Thread Douglas Philips
On 2010 Apr 2, at 8:06 AM, Rich Hickey wrote: On Apr 1, 2010, at 7:37 AM, Konrad Hinsen wrote: - Two characters, . and /, are treated specially even though this is not or not clearly stated in the documnentation. Better don't use those in unqualified symbols. Hmm. There are two sentences i

Re: AOT Compilation Class Hierarchy

2010-04-02 Thread Chas Emerick
Compilation is driven by namespace load-order, so just ensure that you add a (:require com.foo.IFoo) to the ns declaration where you define the Foo class. I seem to remember suggesting that Clojure should implicitly attempt to require namespaces corresponding to classnames being implemented

Re: Set performance

2010-04-02 Thread Chas Emerick
As Clojure moves towards being self-hosted, fewer and fewer of the data structures will be implemented in Java, thereby ensuring dependence on the Clojure runtime. Just FYI. - Chas On Mar 31, 2010, at 12:56 PM, Krukow wrote: It would be nice to have a version of the clojure data structure

Re: Getting started embedding Clojure into an existing codebase

2010-04-02 Thread Chas Emerick
Assuming your environment is set up properly w.r.t. classpaths, spring should work just fine in a REPL. We use spring security for our compojure webapp, and the spring context starts up as expected in our enclojure REPLs. FWIW, we do use maven and the clojure-maven-plugin, which informs N

RE: Newbie question re. calling Java from Clojure

2010-04-02 Thread Kevin
> Here's my best attempt so far: > > -- > (ns piccoloHello > (:gen-class) > (:import (edu.umd.cs.piccolo PCanvas PNode PLayer) >(edu.umd.cs.piccolo.nodes PText) >(edu.umd.cs.piccolox PFrame))) > > (defn create-frame > "Creates the ma

Clojure Ireland

2010-04-02 Thread delboy
Hi, For clojurians living in Ireland, we've set up Clojure Ireland: http://groups.google.com/group/clojure-ireland. We hope to have our first meetup this month. Derek -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Newbie question re. calling Java from Clojure

2010-04-02 Thread Gregg Williams
Hi-- I'm trying to write a GUI-based Java program from within Clojure, and I'm using an interesting library called Piccolo2D (http:// www.piccolo2d.org). The worldwide intersection of Clojure and Piccolo2D is probably *me*, but I'm hoping that someone here can point me in the right direction. I'm

AOT Compilation Class Hierarchy

2010-04-02 Thread Nick Dimiduk
Heya! I'm implementing a simple class hierarchy in clojure to be exposed to external java code using AOT compilation. The library requires I declare an interface extending a base-interface from the library and then provide an implementation class. For example: interface IFoo extends ILibInterface

Re: characters permitted in symbols??

2010-04-02 Thread Rich Hickey
On Apr 1, 2010, at 7:37 AM, Konrad Hinsen wrote: On 1 Apr 2010, at 13:04, Meikel Brandmeyer wrote: Clojure being still young and in flux at certain areas doesn't contradict a currently valid, authoritative documentation. It may be that the list for allowed characters in a symbol is extended a

Re: "," is REAL whitespace...

2010-04-02 Thread Mark J. Reed
try this one: (list,1,2,3) :) Per: I'd say it's also weird if you're coming from a Lisp background - just weird in the opposite direction. But not so weird that it's not useful, mostly for separating key/value pairs from other key/value pairs in a map. It's like Perl's "fat comma" arrow operat

Re: REPL and its command prompt

2010-04-02 Thread Per Vognsen
In most character-buffered REPLs the enter key serves two purposes: quoting a new line character and submitting input to the REPL. Some systems like Mathematica require a special key combination like shift-enter or control-enter to submit input. That is a clean separation of concerns but it is awfu

REPL and its command prompt

2010-04-02 Thread Michael Jaaka
Hi! I think that I've found inconsistency in REPL behavior. Just press ENTER in REPL and you got new command prompt. This shouldn't work like this. New line for clojure is just a whitespace until it is written in quotes (with quotes it becomes an important char of text content). So If it is a whit