Re: Clojure 1.3 treatment of integers and longs
On Tue, Oct 18, 2011 at 7:45 PM, nathanmarz wrote: > Thanks. I read through that and it didn't quite answer my question. To > me it seems more logical that: > > 1. Clojure defaults to longs when you create a new number (with a > literal 0, 1, etc) > 2. You can create ints by doing (int 0) > 3. Clojure never changes the types of things you're using I think you'll find that clojure doesn't change types, except where required, mostly for boxing. Clojure 1.2 would construct a new Integer around an int when required. Clojure 1.3 constructs a new Long around an int instead, because rich has decided he prefers longs and doubles to ints and floats. If you want to do your own boxing prior to using a value in a way that would box it, you can, and your type will not "change" user> (def boxed-by-clojure (.intValue 3)) #'user/boxed-by-clojure user> (type boxed-by-clojure) java.lang.Long user> (def boxed-by-me (Integer. (.intValue 3))) #'user/boxed-by-me user> (type boxed-by-me) java.lang.Integer user> > I find Clojure's behavior of changing the types of primitive ints to > longs highly unusual, and it is causing a lot of pain in upgrading > Storm to 1.3. > > I don't mean to imply that the design choices made were wrong; I know > that Rich et al put a lot of thought and work into these changes. But > I would like to understand why changing the types of ints to longs is > necessary instead of supporting primitive ints as well. > > -Nathan > > > On Oct 18, 2:25 pm, David Nolen wrote: >> 233 messages long thread from June >> 2010,http://groups.google.com/group/clojure/browse_thread/thread/c8c850595... >> >> David >> >> >> >> >> >> >> >> On Tue, Oct 18, 2011 at 5:00 PM, nathanmarz wrote: >> > Hey all, >> >> > I recently started upgrading Storm to Clojure 1.3, and I ran into >> > various issues due to Clojure's treatment of integers and longs. In >> > particular, I have a situation like the following: >> >> > 1. A Java object returns me an int. Let's call this value "v". >> > 2. I put "v" into a map, and pass that map into a Java object >> > 3. I get ClassCastExceptions when that Java object tries to read that >> > Integer and instead gets a Long back >> >> > The error arises due to Clojure's auto-coercion of primitive ints to >> > longs. >> >> > Auto-coercing ints to longs is prone to errors like I ran into, >> > especially when interoperating with Java code. It becomes especially >> > confusing when considering that "Integer" objects do not get coerced >> > to "Long" objects. Also, if Clojure is trying to treat everything as >> > longs, I don't understand why there's an unchecked-divide-int function >> > and not an unchecked-divide-long function. >> >> > What's the rationale behind all this? Why not support both ints and >> > longs? I'm sure this has been discussed before, so feel free to point >> > me to earlier discussions on this. >> >> > -Nathan >> >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "Clojure" group. >> > To post to this group, send email to clojure@googlegroups.com >> > Note that posts from new members are moderated - please be patient with >> > your first post. >> > To unsubscribe from this group, send email to >> > clojure+unsubscr...@googlegroups.com >> > For more options, visit this group at >> >http://groups.google.com/group/clojure?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with your > first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Will clojurescript get in-ns and load?
Is it planned for clojurescript to get *in-ns* and *load*. These would be most useful for code modularisation (see thread Reuse of generic Clojure/ClojureScript code?) Cheers Dave -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Reuse of generic Clojure/ClojureScript code?
If/when clojurescript gets* in-ns* and *load* the previously outlined solution could be improved. I could use load to include platform specific ports of intended core library capability into the generic files. This would mean that you would only need to require the generic file, regardless of platform. requiring or using a .x library would be used only where functionality was not planned or intended to be made portable. This would be very handy Is it planned for these functions to be developed? Cheers Dave -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure 1.3 treatment of integers and longs
Thanks. I read through that and it didn't quite answer my question. To me it seems more logical that: 1. Clojure defaults to longs when you create a new number (with a literal 0, 1, etc) 2. You can create ints by doing (int 0) 3. Clojure never changes the types of things you're using I find Clojure's behavior of changing the types of primitive ints to longs highly unusual, and it is causing a lot of pain in upgrading Storm to 1.3. I don't mean to imply that the design choices made were wrong; I know that Rich et al put a lot of thought and work into these changes. But I would like to understand why changing the types of ints to longs is necessary instead of supporting primitive ints as well. -Nathan On Oct 18, 2:25 pm, David Nolen wrote: > 233 messages long thread from June > 2010,http://groups.google.com/group/clojure/browse_thread/thread/c8c850595... > > David > > > > > > > > On Tue, Oct 18, 2011 at 5:00 PM, nathanmarz wrote: > > Hey all, > > > I recently started upgrading Storm to Clojure 1.3, and I ran into > > various issues due to Clojure's treatment of integers and longs. In > > particular, I have a situation like the following: > > > 1. A Java object returns me an int. Let's call this value "v". > > 2. I put "v" into a map, and pass that map into a Java object > > 3. I get ClassCastExceptions when that Java object tries to read that > > Integer and instead gets a Long back > > > The error arises due to Clojure's auto-coercion of primitive ints to > > longs. > > > Auto-coercing ints to longs is prone to errors like I ran into, > > especially when interoperating with Java code. It becomes especially > > confusing when considering that "Integer" objects do not get coerced > > to "Long" objects. Also, if Clojure is trying to treat everything as > > longs, I don't understand why there's an unchecked-divide-int function > > and not an unchecked-divide-long function. > > > What's the rationale behind all this? Why not support both ints and > > longs? I'm sure this has been discussed before, so feel free to point > > me to earlier discussions on this. > > > -Nathan > > > -- > > You received this message because you are subscribed to the Google > > Groups "Clojure" group. > > To post to this group, send email to clojure@googlegroups.com > > Note that posts from new members are moderated - please be patient with > > your first post. > > To unsubscribe from this group, send email to > > clojure+unsubscr...@googlegroups.com > > For more options, visit this group at > >http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Who will be at QCon SF?
I will be there and am giving a talk in the functional web track http://qconsf.com/sf2011/presentation/One+%28%29+to+Rule+them+All See you on the coast. Cheers, Aaron Bedra -- Clojure/core http://clojure.com On 09/27/2011 06:28 PM, Demetrius Nunes wrote: Hi guys, I'd love to meet with fellow "clojurians" at QCon SF. How many of you will be there? cheers! Demetrius -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Clojure 1.3 treatment of integers and longs
233 messages long thread from June 2010, http://groups.google.com/group/clojure/browse_thread/thread/c8c850595c91cc11/171cacba292a0583 David On Tue, Oct 18, 2011 at 5:00 PM, nathanmarz wrote: > Hey all, > > I recently started upgrading Storm to Clojure 1.3, and I ran into > various issues due to Clojure's treatment of integers and longs. In > particular, I have a situation like the following: > > 1. A Java object returns me an int. Let's call this value "v". > 2. I put "v" into a map, and pass that map into a Java object > 3. I get ClassCastExceptions when that Java object tries to read that > Integer and instead gets a Long back > > The error arises due to Clojure's auto-coercion of primitive ints to > longs. > > Auto-coercing ints to longs is prone to errors like I ran into, > especially when interoperating with Java code. It becomes especially > confusing when considering that "Integer" objects do not get coerced > to "Long" objects. Also, if Clojure is trying to treat everything as > longs, I don't understand why there's an unchecked-divide-int function > and not an unchecked-divide-long function. > > What's the rationale behind all this? Why not support both ints and > longs? I'm sure this has been discussed before, so feel free to point > me to earlier discussions on this. > > -Nathan > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Clojure 1.3 treatment of integers and longs
Hey all, I recently started upgrading Storm to Clojure 1.3, and I ran into various issues due to Clojure's treatment of integers and longs. In particular, I have a situation like the following: 1. A Java object returns me an int. Let's call this value "v". 2. I put "v" into a map, and pass that map into a Java object 3. I get ClassCastExceptions when that Java object tries to read that Integer and instead gets a Long back The error arises due to Clojure's auto-coercion of primitive ints to longs. Auto-coercing ints to longs is prone to errors like I ran into, especially when interoperating with Java code. It becomes especially confusing when considering that "Integer" objects do not get coerced to "Long" objects. Also, if Clojure is trying to treat everything as longs, I don't understand why there's an unchecked-divide-int function and not an unchecked-divide-long function. What's the rationale behind all this? Why not support both ints and longs? I'm sure this has been discussed before, so feel free to point me to earlier discussions on this. -Nathan -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clojure.string no namespace error
Thanks, I think I was trying to wrong thing (don't know why I was trying to use import rather than require). -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clojure.string no namespace error
Here's an example from the REPL that should get you going: user => (require '[clojure.string :as str]) nil user=> (str/split-lines "foo\nbar\r\nbaz\n") ["foo" "bar" "baz"] Cheers, Aaron Bedra -- Clojure/core http://clojure.com On 10/18/2011 05:52 AM, Omer Kudat wrote: Hi all, I've started to teach myself clojure recently, so apologies for a potentially stupid question. I'm using clojure-1.3.0.jar, downloaded very recently. I would like to use clojure.string/split-lines, but I cannot access the namespace. I've tried: (import 'clojure.string) (import 'string) and (:require [clojure.string :as str])) The last one is from the documentation in the string.clj file embedded in the jar. They all throw either a "java.lang.ClassNotFoundException: clojure.string" or a "java.lang.Exception: No namespace: clojure.string". Calling (all-ns) gives me a list of namespaces which does not include string, and (find-ns) doesn't find clojure.string either. Not sure what I'm doing wrong. Any pieces of wisdom? Omer -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: "ClojureScript Mobile" BOF at the Clojure/conj?
On Tue, Oct 18, 2011 at 12:22 PM, Chas Emerick wrote: > On Oct 18, 11:12 am, Michael Fogus wrote: >> > Anyone from the Clojure/conj org committee >> >> While I'm not on the organization committee, I will say that >> side-events like this would be spectacular. The logistics escape me >> at the moment, but perhaps spontaneity is the best approach? > > …or even a little light planning if you really want to get a group > together. There are way too many special interests for any single > body to plan for. Absolutely nothing is keeping someone from creating > a google docs spreadsheet, defining some time slots, and dropping > talks / BOFs / topical hack sessions in, quasi-unconference style. I love this idea -- google spreadsheet of extra events. /me waits for someone to post a link. --Chouser -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: What changed 1.2/1.3 to cause this program slowdown?
I'm not an expert on the topic, but the threadring example has some suspicious ^Integer hints on values that were integers in 1.2 and are longs in 1.3 (ie, they were created from numeric literals). The hints don't seem to be actually being used, so I don't think this has an impact, but perhaps mentioning it will help someone else find the problem. On Oct 18, 9:44 am, Isaac Gouy wrote: > thread-ring Clojure 1.2 > N=50 1.8 secs > N=500 7.1 secs > N=5000 58.3 secs > > thread-ring Clojure 1.3 > N=50 2.8 secs > N=500 25.3 secs > N=5000 >1800 secs > > http://shootout.alioth.debian.org/u64q/program.php?test=threadring&la... > > chameneos-redux Clojure 1.2 > N=50 2.7 secs > N=500 11.5 secs > N=5000 100.0 secs > > chameneos-redux Clojure 1.3 > N=50 2.9 secs > N=500 18.1 secs > N=5000 >1800 secs > > http://shootout.alioth.debian.org/u64q/program.php?test=chameneosredu... -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Macro not working - newbie question
Simpler to just use the field names which are already bound, rather than constructing keywords out of them and calling them with juxt: (defmacro defrecord-withstr [name fields columns include?] (let [displayed (if include? columns (remove (set columns) fields))] `(defrecord ~name ~fields Object (toString [_#] (clojure.string/join " " [~@displayed]) On Oct 18, 9:25 am, "Marshall T. Vandegrift" wrote: > Dusan writes: > > (symbol(str "(str (:" % " " vv "))")) > > This expression is the (immediate) problem child. You are producing a > symbol which contains literal space and parenthesis characters embedded > in it. When you print out the macro-expansion, it looks fine, but the > actual forms generated contain that weird symbol instead of the expected > list structure. > > You do have other problems though -- > > - A symbol prefixed with a colon is just a symbol prefixed with a > colon, not a keyword. You need to use the `keyword' function to > create a keyword from a symbol or string. > > - Instead of calling `gensym' directly, it's probably easier to just > use autogensyms in this sort of situation. > > For fun, here's a (hopefully) more idiomatic version: > > (defmacro defrecord-withstr [name fields columns include?] > (let [displayed (->> (if include? columns (remove (set columns) fields)) > (map keyword))] > `(defrecord ~name ~fields > Object > (toString [this#] > (str/join " " ((juxt ~@displayed) this#)) > > -Marshall -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
What changed 1.2/1.3 to cause this program slowdown?
thread-ring Clojure 1.2 N=50 1.8 secs N=500 7.1 secs N=5000 58.3 secs thread-ring Clojure 1.3 N=50 2.8 secs N=500 25.3 secs N=5000 >1800 secs http://shootout.alioth.debian.org/u64q/program.php?test=threadring&lang=clojure&id=1 chameneos-redux Clojure 1.2 N=50 2.7 secs N=500 11.5 secs N=5000 100.0 secs chameneos-redux Clojure 1.3 N=50 2.9 secs N=500 18.1 secs N=5000 >1800 secs http://shootout.alioth.debian.org/u64q/program.php?test=chameneosredux&lang=clojure&id=1 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Macro not working - newbie question
Dusan writes: > (symbol(str "(str (:" % " " vv "))")) This expression is the (immediate) problem child. You are producing a symbol which contains literal space and parenthesis characters embedded in it. When you print out the macro-expansion, it looks fine, but the actual forms generated contain that weird symbol instead of the expected list structure. You do have other problems though -- - A symbol prefixed with a colon is just a symbol prefixed with a colon, not a keyword. You need to use the `keyword' function to create a keyword from a symbol or string. - Instead of calling `gensym' directly, it's probably easier to just use autogensyms in this sort of situation. For fun, here's a (hopefully) more idiomatic version: (defmacro defrecord-withstr [name fields columns include?] (let [displayed (->> (if include? columns (remove (set columns) fields)) (map keyword))] `(defrecord ~name ~fields Object (toString [this#] (str/join " " ((juxt ~@displayed) this#)) -Marshall -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: "ClojureScript Mobile" BOF at the Clojure/conj?
On Oct 18, 11:12 am, Michael Fogus wrote: > > Anyone from the Clojure/conj org committee > > While I'm not on the organization committee, I will say that > side-events like this would be spectacular. The logistics escape me > at the moment, but perhaps spontaneity is the best approach? …or even a little light planning if you really want to get a group together. There are way too many special interests for any single body to plan for. Absolutely nothing is keeping someone from creating a google docs spreadsheet, defining some time slots, and dropping talks / BOFs / topical hack sessions in, quasi-unconference style. I don't know what accepted etiquette is around doing such things in parallel with "regular" conferences, but I'd think good form would dictate that topics shouldn't "compete" with the scheduled talk. e.g. A ClojureScript mobile BOF probably shouldn't be scheduled opposite the announced ClojureScript talks. In any case, I'd think that the 7pm - 12am period would be a perfect time for topical groups to form. - Chas -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: "ClojureScript Mobile" BOF at the Clojure/conj?
Michael Fogus wrote: > > Anyone from the Clojure/conj org committee > > While I'm not on the organization committee, I will say that > side-events like this would be spectacular. The logistics escape me > at the moment, but perhaps spontaneity is the best approach? As a Raleigh local, I can attest at the availability of some awesome bars, restaurants, and coffee shops within easy walking distance of the Sheraton. Perhaps these would offer locations for any BOFs. I could create a list of places if folks are interested. -- LinkedIn: http://www.linkedin.com/pub/roger-austin/8/a4/60 Twitter: http://twitter.com/RogerTheGeek Google+: https://plus.google.com/117357905892731200369 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Get the name of keyword/symbol in clojurescript
It works! Thanks for all the help. On Tue, Oct 18, 2011 at 5:52 PM, David Nolen wrote: > I see you're not setting the encoding. Try adding the following to the top > of > > > > David > > > On Tue, Oct 18, 2011 at 11:43 AM, Jonathan Fischer Friberg < > odysso...@gmail.com> wrote: > >> I did a minimal example >> https://gist.github.com/1295749 >> >> Result is in the attachment. >> >> >> On Tue, Oct 18, 2011 at 5:22 PM, David Nolen wrote: >> >>> Try removing the following: >>> >>> file.js >>> out >>> >>> and recompiling. I also recommend compiling one of the ClojureScript >>> samples that you haven't checked out yet to see if the issue is >>> reproducible. >>> >>> David >>> >>> On Tue, Oct 18, 2011 at 11:17 AM, Jonathan Fischer Friberg < >>> odysso...@gmail.com> wrote: >>> It works now, and the result is as expected. In the browser I still get the extra characters however. On Tue, Oct 18, 2011 at 5:04 PM, David Nolen wrote: > Have you rerun the bootstrap script since the Rhino upgrade? > > > On Tue, Oct 18, 2011 at 10:33 AM, Jonathan Fischer Friberg < > odysso...@gmail.com> wrote: > >> I can't run that repl, I get >> >> Exception in thread "main" java.lang.RuntimeException: >> java.lang.ClassNotFoundException: org.mozilla.javascript.Context >> at clojure.lang.Util.runtimeException(Util.java:165) >> at clojure.lang.Compiler.eval(Compiler.java:6435) >> at clojure.lang.Compiler.eval(Compiler.java:6414) >> at clojure.lang.Compiler.load(Compiler.java:6861) >> at clojure.lang.RT.loadResourceScript(RT.java:357) >> at clojure.lang.RT.loadResourceScript(RT.java:348) >> at clojure.lang.RT.load(RT.java:427) >> at clojure.lang.RT.load(RT.java:398) >> at clojure.core$load$fn__4610.invoke(core.clj:5386) >> at clojure.core$load.doInvoke(core.clj:5385) >> at clojure.lang.RestFn.invoke(RestFn.java:408) >> at clojure.core$load_one.invoke(core.clj:5200) >> at clojure.core$load_lib.doInvoke(core.clj:5237) >> at clojure.lang.RestFn.applyTo(RestFn.java:142) >> at clojure.core$apply.invoke(core.clj:602) >> at clojure.core$load_libs.doInvoke(core.clj:5271) >> at clojure.lang.RestFn.applyTo(RestFn.java:137) >> at clojure.core$apply.invoke(core.clj:602) >> at clojure.core$require.doInvoke(core.clj:5352) >> at clojure.lang.RestFn.invoke(RestFn.java:408) >> at user$eval1715.invoke(NO_SOURCE_FILE:2) >> at clojure.lang.Compiler.eval(Compiler.java:6424) >> at clojure.lang.Compiler.eval(Compiler.java:6390) >> at clojure.core$eval.invoke(core.clj:2795) >> at clojure.main$eval_opt.invoke(main.clj:296) >> at clojure.main$initialize.invoke(main.clj:315) >> at clojure.main$null_opt.invoke(main.clj:348) >> at clojure.main$main.doInvoke(main.clj:426) >> at clojure.lang.RestFn.invoke(RestFn.java:421) >> at clojure.lang.Var.invoke(Var.java:405) >> at clojure.lang.AFn.applyToHelper(AFn.java:163) >> at clojure.lang.Var.applyTo(Var.java:518) >> at clojure.main.main(main.java:37) >> Caused by: java.lang.ClassNotFoundException: >> org.mozilla.javascript.Context >> at java.net.URLClassLoader$1.run(URLClassLoader.java:217) >> at java.security.AccessController.doPrivileged(Native Method) >> at java.net.URLClassLoader.findClass(URLClassLoader.java:205) >> at >> clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:61) >> at java.lang.ClassLoader.loadClass(ClassLoader.java:321) >> at java.lang.ClassLoader.loadClass(ClassLoader.java:266) >> at java.lang.Class.forName0(Native Method) >> at java.lang.Class.forName(Class.java:186) >> at >> cljs.repl.rhino$eval1719$loading__4505__auto1720.invoke(rhino.clj:9) >> at cljs.repl.rhino$eval1719.invoke(rhino.clj:9) >> at clojure.lang.Compiler.eval(Compiler.java:6424) >> ... 31 more >> >> >> >> On Tue, Oct 18, 2011 at 4:25 PM, David Nolen >> wrote: >> >>> Does the same problem occur when trying this at the REPL (say via >>> script/repljs) ? >>> >>> David >>> >>> >>> On Tue, Oct 18, 2011 at 7:22 AM, Jonathan Fischer Friberg < >>> odysso...@gmail.com> wrote: >>> I'm on the master branch. I compiled the file using 'cljsc file > file.js', and run it in the browser. On Tue, Oct 18, 2011 at 1:16 AM, David Nolen < dnolen.li...@gmail.com> wrote: > Are you using ClojureScript HEAD? If you are and you are still > seeing this under what conditions (advanced mode, browser REPL, etc.) > ? > > David > > On Mon, Oct 17, 2011 at 6:41 PM, Jonathan Fischer Friberg < > odys
Re: Get the name of keyword/symbol in clojurescript
I see you're not setting the encoding. Try adding the following to the top of David On Tue, Oct 18, 2011 at 11:43 AM, Jonathan Fischer Friberg < odysso...@gmail.com> wrote: > I did a minimal example > https://gist.github.com/1295749 > > Result is in the attachment. > > > On Tue, Oct 18, 2011 at 5:22 PM, David Nolen wrote: > >> Try removing the following: >> >> file.js >> out >> >> and recompiling. I also recommend compiling one of the ClojureScript >> samples that you haven't checked out yet to see if the issue is >> reproducible. >> >> David >> >> On Tue, Oct 18, 2011 at 11:17 AM, Jonathan Fischer Friberg < >> odysso...@gmail.com> wrote: >> >>> It works now, and the result is as expected. >>> >>> In the browser I still get the extra characters however. >>> >>> >>> On Tue, Oct 18, 2011 at 5:04 PM, David Nolen wrote: >>> Have you rerun the bootstrap script since the Rhino upgrade? On Tue, Oct 18, 2011 at 10:33 AM, Jonathan Fischer Friberg < odysso...@gmail.com> wrote: > I can't run that repl, I get > > Exception in thread "main" java.lang.RuntimeException: > java.lang.ClassNotFoundException: org.mozilla.javascript.Context > at clojure.lang.Util.runtimeException(Util.java:165) > at clojure.lang.Compiler.eval(Compiler.java:6435) > at clojure.lang.Compiler.eval(Compiler.java:6414) > at clojure.lang.Compiler.load(Compiler.java:6861) > at clojure.lang.RT.loadResourceScript(RT.java:357) > at clojure.lang.RT.loadResourceScript(RT.java:348) > at clojure.lang.RT.load(RT.java:427) > at clojure.lang.RT.load(RT.java:398) > at clojure.core$load$fn__4610.invoke(core.clj:5386) > at clojure.core$load.doInvoke(core.clj:5385) > at clojure.lang.RestFn.invoke(RestFn.java:408) > at clojure.core$load_one.invoke(core.clj:5200) > at clojure.core$load_lib.doInvoke(core.clj:5237) > at clojure.lang.RestFn.applyTo(RestFn.java:142) > at clojure.core$apply.invoke(core.clj:602) > at clojure.core$load_libs.doInvoke(core.clj:5271) > at clojure.lang.RestFn.applyTo(RestFn.java:137) > at clojure.core$apply.invoke(core.clj:602) > at clojure.core$require.doInvoke(core.clj:5352) > at clojure.lang.RestFn.invoke(RestFn.java:408) > at user$eval1715.invoke(NO_SOURCE_FILE:2) > at clojure.lang.Compiler.eval(Compiler.java:6424) > at clojure.lang.Compiler.eval(Compiler.java:6390) > at clojure.core$eval.invoke(core.clj:2795) > at clojure.main$eval_opt.invoke(main.clj:296) > at clojure.main$initialize.invoke(main.clj:315) > at clojure.main$null_opt.invoke(main.clj:348) > at clojure.main$main.doInvoke(main.clj:426) > at clojure.lang.RestFn.invoke(RestFn.java:421) > at clojure.lang.Var.invoke(Var.java:405) > at clojure.lang.AFn.applyToHelper(AFn.java:163) > at clojure.lang.Var.applyTo(Var.java:518) > at clojure.main.main(main.java:37) > Caused by: java.lang.ClassNotFoundException: > org.mozilla.javascript.Context > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) > at > clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:61) > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:186) > at > cljs.repl.rhino$eval1719$loading__4505__auto1720.invoke(rhino.clj:9) > at cljs.repl.rhino$eval1719.invoke(rhino.clj:9) > at clojure.lang.Compiler.eval(Compiler.java:6424) > ... 31 more > > > > On Tue, Oct 18, 2011 at 4:25 PM, David Nolen > wrote: > >> Does the same problem occur when trying this at the REPL (say via >> script/repljs) ? >> >> David >> >> >> On Tue, Oct 18, 2011 at 7:22 AM, Jonathan Fischer Friberg < >> odysso...@gmail.com> wrote: >> >>> I'm on the master branch. >>> >>> I compiled the file using 'cljsc file > file.js', and run it in the >>> browser. >>> >>> >>> On Tue, Oct 18, 2011 at 1:16 AM, David Nolen >> > wrote: >>> Are you using ClojureScript HEAD? If you are and you are still seeing this under what conditions (advanced mode, browser REPL, etc.) ? David On Mon, Oct 17, 2011 at 6:41 PM, Jonathan Fischer Friberg < odysso...@gmail.com> wrote: > Hi, > > As I understand it, clojurescript uses some unicode characters to > identify keywords/symbols. > I guess that's why (str 'a) gives me ï·‘'a > I thought that this was intenti
Re: Get the name of keyword/symbol in clojurescript
Try removing the following: file.js out and recompiling. I also recommend compiling one of the ClojureScript samples that you haven't checked out yet to see if the issue is reproducible. David On Tue, Oct 18, 2011 at 11:17 AM, Jonathan Fischer Friberg < odysso...@gmail.com> wrote: > It works now, and the result is as expected. > > In the browser I still get the extra characters however. > > > On Tue, Oct 18, 2011 at 5:04 PM, David Nolen wrote: > >> Have you rerun the bootstrap script since the Rhino upgrade? >> >> >> On Tue, Oct 18, 2011 at 10:33 AM, Jonathan Fischer Friberg < >> odysso...@gmail.com> wrote: >> >>> I can't run that repl, I get >>> >>> Exception in thread "main" java.lang.RuntimeException: >>> java.lang.ClassNotFoundException: org.mozilla.javascript.Context >>> at clojure.lang.Util.runtimeException(Util.java:165) >>> at clojure.lang.Compiler.eval(Compiler.java:6435) >>> at clojure.lang.Compiler.eval(Compiler.java:6414) >>> at clojure.lang.Compiler.load(Compiler.java:6861) >>> at clojure.lang.RT.loadResourceScript(RT.java:357) >>> at clojure.lang.RT.loadResourceScript(RT.java:348) >>> at clojure.lang.RT.load(RT.java:427) >>> at clojure.lang.RT.load(RT.java:398) >>> at clojure.core$load$fn__4610.invoke(core.clj:5386) >>> at clojure.core$load.doInvoke(core.clj:5385) >>> at clojure.lang.RestFn.invoke(RestFn.java:408) >>> at clojure.core$load_one.invoke(core.clj:5200) >>> at clojure.core$load_lib.doInvoke(core.clj:5237) >>> at clojure.lang.RestFn.applyTo(RestFn.java:142) >>> at clojure.core$apply.invoke(core.clj:602) >>> at clojure.core$load_libs.doInvoke(core.clj:5271) >>> at clojure.lang.RestFn.applyTo(RestFn.java:137) >>> at clojure.core$apply.invoke(core.clj:602) >>> at clojure.core$require.doInvoke(core.clj:5352) >>> at clojure.lang.RestFn.invoke(RestFn.java:408) >>> at user$eval1715.invoke(NO_SOURCE_FILE:2) >>> at clojure.lang.Compiler.eval(Compiler.java:6424) >>> at clojure.lang.Compiler.eval(Compiler.java:6390) >>> at clojure.core$eval.invoke(core.clj:2795) >>> at clojure.main$eval_opt.invoke(main.clj:296) >>> at clojure.main$initialize.invoke(main.clj:315) >>> at clojure.main$null_opt.invoke(main.clj:348) >>> at clojure.main$main.doInvoke(main.clj:426) >>> at clojure.lang.RestFn.invoke(RestFn.java:421) >>> at clojure.lang.Var.invoke(Var.java:405) >>> at clojure.lang.AFn.applyToHelper(AFn.java:163) >>> at clojure.lang.Var.applyTo(Var.java:518) >>> at clojure.main.main(main.java:37) >>> Caused by: java.lang.ClassNotFoundException: >>> org.mozilla.javascript.Context >>> at java.net.URLClassLoader$1.run(URLClassLoader.java:217) >>> at java.security.AccessController.doPrivileged(Native Method) >>> at java.net.URLClassLoader.findClass(URLClassLoader.java:205) >>> at >>> clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:61) >>> at java.lang.ClassLoader.loadClass(ClassLoader.java:321) >>> at java.lang.ClassLoader.loadClass(ClassLoader.java:266) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Class.java:186) >>> at >>> cljs.repl.rhino$eval1719$loading__4505__auto1720.invoke(rhino.clj:9) >>> at cljs.repl.rhino$eval1719.invoke(rhino.clj:9) >>> at clojure.lang.Compiler.eval(Compiler.java:6424) >>> ... 31 more >>> >>> >>> >>> On Tue, Oct 18, 2011 at 4:25 PM, David Nolen wrote: >>> Does the same problem occur when trying this at the REPL (say via script/repljs) ? David On Tue, Oct 18, 2011 at 7:22 AM, Jonathan Fischer Friberg < odysso...@gmail.com> wrote: > I'm on the master branch. > > I compiled the file using 'cljsc file > file.js', and run it in the > browser. > > > On Tue, Oct 18, 2011 at 1:16 AM, David Nolen > wrote: > >> Are you using ClojureScript HEAD? If you are and you are still seeing >> this under what conditions (advanced mode, browser REPL, etc.) ? >> >> David >> >> On Mon, Oct 17, 2011 at 6:41 PM, Jonathan Fischer Friberg < >> odysso...@gmail.com> wrote: >> >>> Hi, >>> >>> As I understand it, clojurescript uses some unicode characters to >>> identify keywords/symbols. >>> I guess that's why (str 'a) gives me ï·‘'a >>> I thought that this was intentional, and that (name 'a) would give me >>> "a", but I got the same result as with (str). >>> >>> So how do I extract the name from a symbol or keyword in >>> clojurescript? >>> Also, is this behavior intentional, and if so, why? >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To post to this group, send email to clojure@googlegroups.com >>> Note that posts from new members are moderated - please be patient >>> with your first post. >>> To unsubscribe from this
Re: Get the name of keyword/symbol in clojurescript
It works now, and the result is as expected. In the browser I still get the extra characters however. On Tue, Oct 18, 2011 at 5:04 PM, David Nolen wrote: > Have you rerun the bootstrap script since the Rhino upgrade? > > > On Tue, Oct 18, 2011 at 10:33 AM, Jonathan Fischer Friberg < > odysso...@gmail.com> wrote: > >> I can't run that repl, I get >> >> Exception in thread "main" java.lang.RuntimeException: >> java.lang.ClassNotFoundException: org.mozilla.javascript.Context >> at clojure.lang.Util.runtimeException(Util.java:165) >> at clojure.lang.Compiler.eval(Compiler.java:6435) >> at clojure.lang.Compiler.eval(Compiler.java:6414) >> at clojure.lang.Compiler.load(Compiler.java:6861) >> at clojure.lang.RT.loadResourceScript(RT.java:357) >> at clojure.lang.RT.loadResourceScript(RT.java:348) >> at clojure.lang.RT.load(RT.java:427) >> at clojure.lang.RT.load(RT.java:398) >> at clojure.core$load$fn__4610.invoke(core.clj:5386) >> at clojure.core$load.doInvoke(core.clj:5385) >> at clojure.lang.RestFn.invoke(RestFn.java:408) >> at clojure.core$load_one.invoke(core.clj:5200) >> at clojure.core$load_lib.doInvoke(core.clj:5237) >> at clojure.lang.RestFn.applyTo(RestFn.java:142) >> at clojure.core$apply.invoke(core.clj:602) >> at clojure.core$load_libs.doInvoke(core.clj:5271) >> at clojure.lang.RestFn.applyTo(RestFn.java:137) >> at clojure.core$apply.invoke(core.clj:602) >> at clojure.core$require.doInvoke(core.clj:5352) >> at clojure.lang.RestFn.invoke(RestFn.java:408) >> at user$eval1715.invoke(NO_SOURCE_FILE:2) >> at clojure.lang.Compiler.eval(Compiler.java:6424) >> at clojure.lang.Compiler.eval(Compiler.java:6390) >> at clojure.core$eval.invoke(core.clj:2795) >> at clojure.main$eval_opt.invoke(main.clj:296) >> at clojure.main$initialize.invoke(main.clj:315) >> at clojure.main$null_opt.invoke(main.clj:348) >> at clojure.main$main.doInvoke(main.clj:426) >> at clojure.lang.RestFn.invoke(RestFn.java:421) >> at clojure.lang.Var.invoke(Var.java:405) >> at clojure.lang.AFn.applyToHelper(AFn.java:163) >> at clojure.lang.Var.applyTo(Var.java:518) >> at clojure.main.main(main.java:37) >> Caused by: java.lang.ClassNotFoundException: >> org.mozilla.javascript.Context >> at java.net.URLClassLoader$1.run(URLClassLoader.java:217) >> at java.security.AccessController.doPrivileged(Native Method) >> at java.net.URLClassLoader.findClass(URLClassLoader.java:205) >> at >> clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:61) >> at java.lang.ClassLoader.loadClass(ClassLoader.java:321) >> at java.lang.ClassLoader.loadClass(ClassLoader.java:266) >> at java.lang.Class.forName0(Native Method) >> at java.lang.Class.forName(Class.java:186) >> at >> cljs.repl.rhino$eval1719$loading__4505__auto1720.invoke(rhino.clj:9) >> at cljs.repl.rhino$eval1719.invoke(rhino.clj:9) >> at clojure.lang.Compiler.eval(Compiler.java:6424) >> ... 31 more >> >> >> >> On Tue, Oct 18, 2011 at 4:25 PM, David Nolen wrote: >> >>> Does the same problem occur when trying this at the REPL (say via >>> script/repljs) ? >>> >>> David >>> >>> >>> On Tue, Oct 18, 2011 at 7:22 AM, Jonathan Fischer Friberg < >>> odysso...@gmail.com> wrote: >>> I'm on the master branch. I compiled the file using 'cljsc file > file.js', and run it in the browser. On Tue, Oct 18, 2011 at 1:16 AM, David Nolen wrote: > Are you using ClojureScript HEAD? If you are and you are still seeing > this under what conditions (advanced mode, browser REPL, etc.) ? > > David > > On Mon, Oct 17, 2011 at 6:41 PM, Jonathan Fischer Friberg < > odysso...@gmail.com> wrote: > >> Hi, >> >> As I understand it, clojurescript uses some unicode characters to >> identify keywords/symbols. >> I guess that's why (str 'a) gives me ï·‘'a >> I thought that this was intentional, and that (name 'a) would give me >> "a", but I got the same result as with (str). >> >> So how do I extract the name from a symbol or keyword in >> clojurescript? >> Also, is this behavior intentional, and if so, why? >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient >> with your first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - p
Re: "ClojureScript Mobile" BOF at the Clojure/conj?
> Anyone from the Clojure/conj org committee While I'm not on the organization committee, I will say that side-events like this would be spectacular. The logistics escape me at the moment, but perhaps spontaneity is the best approach? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Get the name of keyword/symbol in clojurescript
Have you rerun the bootstrap script since the Rhino upgrade? On Tue, Oct 18, 2011 at 10:33 AM, Jonathan Fischer Friberg < odysso...@gmail.com> wrote: > I can't run that repl, I get > > Exception in thread "main" java.lang.RuntimeException: > java.lang.ClassNotFoundException: org.mozilla.javascript.Context > at clojure.lang.Util.runtimeException(Util.java:165) > at clojure.lang.Compiler.eval(Compiler.java:6435) > at clojure.lang.Compiler.eval(Compiler.java:6414) > at clojure.lang.Compiler.load(Compiler.java:6861) > at clojure.lang.RT.loadResourceScript(RT.java:357) > at clojure.lang.RT.loadResourceScript(RT.java:348) > at clojure.lang.RT.load(RT.java:427) > at clojure.lang.RT.load(RT.java:398) > at clojure.core$load$fn__4610.invoke(core.clj:5386) > at clojure.core$load.doInvoke(core.clj:5385) > at clojure.lang.RestFn.invoke(RestFn.java:408) > at clojure.core$load_one.invoke(core.clj:5200) > at clojure.core$load_lib.doInvoke(core.clj:5237) > at clojure.lang.RestFn.applyTo(RestFn.java:142) > at clojure.core$apply.invoke(core.clj:602) > at clojure.core$load_libs.doInvoke(core.clj:5271) > at clojure.lang.RestFn.applyTo(RestFn.java:137) > at clojure.core$apply.invoke(core.clj:602) > at clojure.core$require.doInvoke(core.clj:5352) > at clojure.lang.RestFn.invoke(RestFn.java:408) > at user$eval1715.invoke(NO_SOURCE_FILE:2) > at clojure.lang.Compiler.eval(Compiler.java:6424) > at clojure.lang.Compiler.eval(Compiler.java:6390) > at clojure.core$eval.invoke(core.clj:2795) > at clojure.main$eval_opt.invoke(main.clj:296) > at clojure.main$initialize.invoke(main.clj:315) > at clojure.main$null_opt.invoke(main.clj:348) > at clojure.main$main.doInvoke(main.clj:426) > at clojure.lang.RestFn.invoke(RestFn.java:421) > at clojure.lang.Var.invoke(Var.java:405) > at clojure.lang.AFn.applyToHelper(AFn.java:163) > at clojure.lang.Var.applyTo(Var.java:518) > at clojure.main.main(main.java:37) > Caused by: java.lang.ClassNotFoundException: org.mozilla.javascript.Context > at java.net.URLClassLoader$1.run(URLClassLoader.java:217) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:205) > at > clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:61) > at java.lang.ClassLoader.loadClass(ClassLoader.java:321) > at java.lang.ClassLoader.loadClass(ClassLoader.java:266) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:186) > at > cljs.repl.rhino$eval1719$loading__4505__auto1720.invoke(rhino.clj:9) > at cljs.repl.rhino$eval1719.invoke(rhino.clj:9) > at clojure.lang.Compiler.eval(Compiler.java:6424) > ... 31 more > > > > On Tue, Oct 18, 2011 at 4:25 PM, David Nolen wrote: > >> Does the same problem occur when trying this at the REPL (say via >> script/repljs) ? >> >> David >> >> >> On Tue, Oct 18, 2011 at 7:22 AM, Jonathan Fischer Friberg < >> odysso...@gmail.com> wrote: >> >>> I'm on the master branch. >>> >>> I compiled the file using 'cljsc file > file.js', and run it in the >>> browser. >>> >>> >>> On Tue, Oct 18, 2011 at 1:16 AM, David Nolen wrote: >>> Are you using ClojureScript HEAD? If you are and you are still seeing this under what conditions (advanced mode, browser REPL, etc.) ? David On Mon, Oct 17, 2011 at 6:41 PM, Jonathan Fischer Friberg < odysso...@gmail.com> wrote: > Hi, > > As I understand it, clojurescript uses some unicode characters to > identify keywords/symbols. > I guess that's why (str 'a) gives me ï·‘'a > I thought that this was intentional, and that (name 'a) would give me > "a", but I got the same result as with (str). > > So how do I extract the name from a symbol or keyword in > clojurescript? > Also, is this behavior intentional, and if so, why? > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en >>> >>> >>> -- >>> You received this message becaus
Re: Is there a reader setting support BigDecimal by default?
Scott Hickey writes: Hi Scott, > I'm looking to avoid qualifying every number that has a decimal point > with an M. For the "business" applications I've built over the last 25 > years (credit card processing, healthcare claims, loans,etc.), there's > never been a situation where inexact numbers were appropriate. Nobody wants inexact numbers, but one has to trade speed with exactness. And usually, you should refrain from using floating points at all, no matter if BigDecimal or Double. Clojure has rationals, so unless you have to use java.lang.Math's functions or PI and E constants, you can possibly do all calculations with rationals, and when you really need a float, use (bigdec my-rational) to coerce it to a BigDecimal. > That's why I was hoping for a global default for reading decimal > numbers as BigDecimal instead of IEEE floats or doubles. I've just checked, and that's hard-coded in clojure.lang.LispReader. Bye, Tassilo -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Get the name of keyword/symbol in clojurescript
I can't run that repl, I get Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.Context at clojure.lang.Util.runtimeException(Util.java:165) at clojure.lang.Compiler.eval(Compiler.java:6435) at clojure.lang.Compiler.eval(Compiler.java:6414) at clojure.lang.Compiler.load(Compiler.java:6861) at clojure.lang.RT.loadResourceScript(RT.java:357) at clojure.lang.RT.loadResourceScript(RT.java:348) at clojure.lang.RT.load(RT.java:427) at clojure.lang.RT.load(RT.java:398) at clojure.core$load$fn__4610.invoke(core.clj:5386) at clojure.core$load.doInvoke(core.clj:5385) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5200) at clojure.core$load_lib.doInvoke(core.clj:5237) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:602) at clojure.core$load_libs.doInvoke(core.clj:5271) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:602) at clojure.core$require.doInvoke(core.clj:5352) at clojure.lang.RestFn.invoke(RestFn.java:408) at user$eval1715.invoke(NO_SOURCE_FILE:2) at clojure.lang.Compiler.eval(Compiler.java:6424) at clojure.lang.Compiler.eval(Compiler.java:6390) at clojure.core$eval.invoke(core.clj:2795) at clojure.main$eval_opt.invoke(main.clj:296) at clojure.main$initialize.invoke(main.clj:315) at clojure.main$null_opt.invoke(main.clj:348) at clojure.main$main.doInvoke(main.clj:426) at clojure.lang.RestFn.invoke(RestFn.java:421) at clojure.lang.Var.invoke(Var.java:405) at clojure.lang.AFn.applyToHelper(AFn.java:163) at clojure.lang.Var.applyTo(Var.java:518) at clojure.main.main(main.java:37) Caused by: java.lang.ClassNotFoundException: org.mozilla.javascript.Context at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:61) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at cljs.repl.rhino$eval1719$loading__4505__auto1720.invoke(rhino.clj:9) at cljs.repl.rhino$eval1719.invoke(rhino.clj:9) at clojure.lang.Compiler.eval(Compiler.java:6424) ... 31 more On Tue, Oct 18, 2011 at 4:25 PM, David Nolen wrote: > Does the same problem occur when trying this at the REPL (say via > script/repljs) ? > > David > > > On Tue, Oct 18, 2011 at 7:22 AM, Jonathan Fischer Friberg < > odysso...@gmail.com> wrote: > >> I'm on the master branch. >> >> I compiled the file using 'cljsc file > file.js', and run it in the >> browser. >> >> >> On Tue, Oct 18, 2011 at 1:16 AM, David Nolen wrote: >> >>> Are you using ClojureScript HEAD? If you are and you are still seeing >>> this under what conditions (advanced mode, browser REPL, etc.) ? >>> >>> David >>> >>> On Mon, Oct 17, 2011 at 6:41 PM, Jonathan Fischer Friberg < >>> odysso...@gmail.com> wrote: >>> Hi, As I understand it, clojurescript uses some unicode characters to identify keywords/symbols. I guess that's why (str 'a) gives me ï·‘'a I thought that this was intentional, and that (name 'a) would give me "a", but I got the same result as with (str). So how do I extract the name from a symbol or keyword in clojurescript? Also, is this behavior intentional, and if so, why? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To post to this group, send email to clojure@googlegroups.com >>> Note that posts from new members are moderated - please be patient with >>> your first post. >>> To unsubscribe from this group, send email to >>> clojure+unsubscr...@googlegroups.com >>> For more options, visit this group at >>> http://groups.google.com/group/clojure?hl=en >> >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more option
Re: Get the name of keyword/symbol in clojurescript
Does the same problem occur when trying this at the REPL (say via script/repljs) ? David On Tue, Oct 18, 2011 at 7:22 AM, Jonathan Fischer Friberg < odysso...@gmail.com> wrote: > I'm on the master branch. > > I compiled the file using 'cljsc file > file.js', and run it in the > browser. > > > On Tue, Oct 18, 2011 at 1:16 AM, David Nolen wrote: > >> Are you using ClojureScript HEAD? If you are and you are still seeing this >> under what conditions (advanced mode, browser REPL, etc.) ? >> >> David >> >> On Mon, Oct 17, 2011 at 6:41 PM, Jonathan Fischer Friberg < >> odysso...@gmail.com> wrote: >> >>> Hi, >>> >>> As I understand it, clojurescript uses some unicode characters to >>> identify keywords/symbols. >>> I guess that's why (str 'a) gives me ï·‘'a >>> I thought that this was intentional, and that (name 'a) would give me >>> "a", but I got the same result as with (str). >>> >>> So how do I extract the name from a symbol or keyword in clojurescript? >>> Also, is this behavior intentional, and if so, why? >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Clojure" group. >>> To post to this group, send email to clojure@googlegroups.com >>> Note that posts from new members are moderated - please be patient with >>> your first post. >>> To unsubscribe from this group, send email to >>> clojure+unsubscr...@googlegroups.com >>> For more options, visit this group at >>> http://groups.google.com/group/clojure?hl=en >> >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Is there a reader setting support BigDecimal by default?
I'm looking to avoid qualifying every number that has a decimal point with an M. For the "business" applications I've built over the last 25 years (credit card processing, healthcare claims, loans,etc.), there's never been a situation where inexact numbers were appropriate. That's why I was hoping for a global default for reading decimal numbers as BigDecimal instead of IEEE floats or doubles. Scott Hickey -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: clojure.string no namespace error
If you do a (require 'clojure.string) then all vars will be accessible as clojure.string/... e.g.clojure.string/split-lines . You can use "use" to import the vars into the current namespane: (use 'clojure.string) This wil make available all vars from clojure.string in you current namespace (e.g. user). The later syntax is for use within the macro "ns" to declare a namespace, e.g. (ns user (:require [clojure.string :as str])) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
clojure.string no namespace error
Hi all, I've started to teach myself clojure recently, so apologies for a potentially stupid question. I'm using clojure-1.3.0.jar, downloaded very recently. I would like to use clojure.string/split-lines, but I cannot access the namespace. I've tried: (import 'clojure.string) (import 'string) and (:require [clojure.string :as str])) The last one is from the documentation in the string.clj file embedded in the jar. They all throw either a "java.lang.ClassNotFoundException: clojure.string" or a "java.lang.Exception: No namespace: clojure.string". Calling (all-ns) gives me a list of namespaces which does not include string, and (find-ns) doesn't find clojure.string either. Not sure what I'm doing wrong. Any pieces of wisdom? Omer -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Macro not working - newbie question
I just finished my first macro: (defmacro defrecord-withstr [recordname include columns recordargs] (let [ vv (gensym) stato (let [cols (if include columns (vec(seq(clojure.set/difference (set recordargs) (set columns) ] (vec(interleave (vec(map #(str ":" %) cols)) (vec(map #(symbol(str "(str (:" % " " vv "))")) cols )) )))] `(defrecord ~recordname [~@recordargs] Object (~(symbol "toString") [~vv] (reduce #(str %1 " " %2) ~stato ) ))) ) It should override the toString for records so that it prints just the chosen columns. If i do the macroexpand: user> (macroexpand-1 '(defrecord-withstr Test true [a b] [a b c d])) (clojure.core/defrecord Test [a b c d] java.lang.Object (toString [G__7830] (clojure.core/reduce (fn* [p1__7524__7526__auto__ p2__7525__7527__auto__] (clojure.core/str p1__7524__7526__auto__ " " p2__7525__7527__auto__)) [":a" (str (:a G__7830)) ":b" (str (:b G__7830))]))) When I try to execute that everything works OK: user> (clojure.core/defrecord Test [a b c d] java.lang.Object (toString [G__7830] (clojure.core/reduce (fn* [p1__7524__7526__auto__ p2__7525__7527__auto__] (clojure.core/str p1__7524__7526__auto__ " " p2__7525__7527__auto__)) [":a" (str (:a G__7830)) ":b" (str (:b G__7830))]))) user.Test user> (def tt (Test. 1 2 3 4)) #'user/tt user> tt #:user.Test{:a 1, :b 2, :c 3, :d 4} user> (str tt) ":a 1 :b 2" But when I call this directly, it doesn't work: user> (defrecord-withstr Test2 true [a b] [a b c d]) Unable to resolve symbol: (str (:a G__7900)) in this context [Thrown class java.lang.Exception] Restarts: 0: [QUIT] Quit to the SLIME top level Backtrace: 0: clojure.lang.Compiler.resolveIn(Compiler.java:5677) 1: clojure.lang.Compiler.resolve(Compiler.java:5621) 2: clojure.lang.Compiler.analyzeSymbol(Compiler.java:5584) 3: clojure.lang.Compiler.analyze(Compiler.java:5172) 4: clojure.lang.Compiler.analyze(Compiler.java:5151) 5: clojure.lang.Compiler$VectorExpr.parse(Compiler.java:2591) 6: clojure.lang.Compiler.analyze(Compiler.java:5192) 7: clojure.lang.Compiler.analyze(Compiler.java:5151) 8: clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3057) 9: clojure.lang.Compiler.analyzeSeq(Compiler.java:5371) 10: clojure.lang.Compiler.analyze(Compiler.java:5190) It must be some namespace issue, but I just don't understand what is the problem... Thx Dusan -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Get the name of keyword/symbol in clojurescript
I'm on the master branch. I compiled the file using 'cljsc file > file.js', and run it in the browser. On Tue, Oct 18, 2011 at 1:16 AM, David Nolen wrote: > Are you using ClojureScript HEAD? If you are and you are still seeing this > under what conditions (advanced mode, browser REPL, etc.) ? > > David > > On Mon, Oct 17, 2011 at 6:41 PM, Jonathan Fischer Friberg < > odysso...@gmail.com> wrote: > >> Hi, >> >> As I understand it, clojurescript uses some unicode characters to identify >> keywords/symbols. >> I guess that's why (str 'a) gives me ï·‘'a >> I thought that this was intentional, and that (name 'a) would give me "a", >> but I got the same result as with (str). >> >> So how do I extract the name from a symbol or keyword in clojurescript? >> Also, is this behavior intentional, and if so, why? >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Save your ears - use Overtone 0.5.0
'tis that time again when we jump around in celebration of the new and the crazy: Overtone 0.5.0 is out! Hip-hip-hooray! So, what's new? First up we have some fantastic new committers. Please give a warm welcome to: * Nick Orton * Kevin Neaton * Jowl Gluth * Chris Ford * Philip Potter In terms of features, the most exciting, life-saving thing is the integration of our new ANTI-EAR-BLEED (™) tech. Yes, that's right - no more tintinnabulation of the ear-drum after the triggering of a badly designed synth causes your headphones to scream louder than your little sister ever could. All sound is now limited and clipped with warning messages sent to stdout when your audio goes above a safe threshold. We've also got a bunch of nice fixes, extra utility functions and other goodies. The full changelog is here: https://github.com/overtone/overtone/blob/master/CHANGELOG.md Also, the CheatSheet has been updated for your enjoyment: http://cloud.github.com/downloads/overtone/overtone/overtone-cheat-sheet.pdf So what are you waiting for? Go grab a copy and make some crazy sounds from your Clojure REPL: http://github.com/overtone/overtone http://clojars.org/overtone Sam --- http://sam.aaron.name -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: trouble setting up emacs
run this script in your .emacs.d directory -- #!/bin/sh git clone https://github.com/technomancy/clojure-mode.git wget -P paredit http://mumble.net/~campbell/emacs/paredit.el wget http://download.savannah.gnu.org/releases/color-theme/color-theme-6.6.0.tar.gz mkdir color-theme tar --strip-components=1 --directory=color-theme -xzf color- theme-6.6.0.tar.gz rm color-theme-6.6.0.tar.gz -- init.el -- (add-to-list 'load-path "~/.emacs.d/") ;; clojure-mode (add-to-list 'load-path "~/.emacs.d/clojure-mode") (require 'clojure-mode) (fset 'compile-and-goto-repl "\C-x\C-s\C-c\C-k\C-c\C-z") (global-set-key (kbd "C-c C-g C-r") 'compile-and-goto-repl) (global-set-key (kbd "C-c C-j C-i") 'clojure-jack-in) ;; paredit (add-to-list 'load-path "~/.emacs.d/paredit") (require 'paredit) (add-hook 'clojure-mode-hook 'enable-paredit-mode) (global-set-key (kbd "M-p M-m e") 'enable-paredit-mode) (global-set-key (kbd "M-p M-m d") 'disable-paredit-mode) ;; color theme (add-to-list 'load-path "~/.emacs.d/color-theme") (require 'color-theme) (eval-after-load "color-theme" '(progn (color-theme-initialize))) -- Start emacs, change current directory (M-x cd) to a leiningen project root and press C-c C-j C-i.It should start clojure repl. You will need swank as dev dependency. :dev-dependencies [[swank-clojure "1.3.1"] [midje "1.1.1"]] hth, Maris On Oct 18, 4:32 am, Bruce Gordon wrote: > I am trying to follow the directions > athttp://dev.clojure.org/display/doc/Getting+Started+with+Emacs. > 1. I want to install the Emacs Starter Kit. The directions > athttp://dev.clojure.org/display/doc/Getting+Started+with+Emacsmention > "GNU Emacs 23 or 24 is recommended", however > https://github.com/technomancy/emacs-starter-kit > says "You'll need Emacs 24". The directions say "precompiled versions > are readily available for Debian-based systems...". I'm using a Debian > based system. so I went tohttp://emacs.naquadah.org/. > a. I executed> wget -q -O -http://emacs.naquadah.org/key.gpg| sudo > apt-key add - > b. I'm now confused as to which version I want: Stable? If so I should > then follow the directions to add 2 lines to /etc/apt/sources.list, > and then what do I do? > > 2. Once I get emacs 24 installed, the directions sort of leave off > with " In both cases, you need to launch a Clojure instance with the > correct classpath settings. This is most commonly done using a build > tool such as Leiningen. For instructions see the Build Tools section > of Getting Started." Going > tohttp://dev.clojure.org/display/doc/Getting+Started > and perusing the Build Tools doesn't explain how to setup and launch a > Clojure instance. I see some explanations > athttp://blog.bensmann.com/setting-up-a-clojure-development-environment > but don't know if that includes some obsolete directions. > > thanks, -Bruce -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en