Re: Understanding unmatched parenthesis in read-string

2013-04-29 Thread Weber, Martin S
user= (doc read-string)
-
clojure.core/read-string
([s])
  Reads *one* object from the string s
nil
(emphasis on *one* by me)

one object from :a( = :a; :a) = :a; ( …  = fail; )… = fail. (remember 
whitespace in front of a paren doesn't matter)

Have fun.

From: noahlz nzuc...@gmail.commailto:nzuc...@gmail.com
Reply-To: Clojure clojure@googlegroups.commailto:clojure@googlegroups.com
Date: Monday, April 29, 2013 16:26
To: Clojure clojure@googlegroups.commailto:clojure@googlegroups.com
Subject: Understanding unmatched parenthesis in read-string

(Disclaimer: I post this aware that read-string is considered dangerous for 
untrusted code and having starred tools.reader)

I was writing some code using read-string and encountered the following 
(somewhat odd?) behavior:

Clojure 1.5.1
user= (read-string 1000N()
1000N
user= (read-string 1000N))
1000N
user= (read-string (1000N)
RuntimeException EOF while reading  clojure.lang.Util.runtimeException 
(Util.java:219)

user= (read-string )1000N)
RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException 
(Util.java:219)


So if the string ends with an unmatched ) or (, the preceding value gets 
returned and the unmatched character discarded. But if the string starts with 
an unmatched parens - EOF (as expected). I was a little surprised as I expected 
the first to cases to throw some kind of RuntimeException.

What is the explanation for this behavior if any, and where can I go / read 
more about the underlying theory of correctly handling this case? I'm aware 
that lexical parsing is a big topic - just wondering what the ruling was here 
(if any) and looking for a jumping off point into further readings. Also if 
this was discussed elsewhere (searching read-string unmatched paren yielded 
nothing).

Thanks!


--
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to 
clojure@googlegroups.commailto: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.commailto: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 unsubscribe from this group and stop receiving emails from it, send an email 
to 
clojure+unsubscr...@googlegroups.commailto:clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Clojurescript bug

2013-03-05 Thread Weber, Martin S
$ lein search clojurescript
Searching over Artifact ID...
 == Showing page 1 / 2
[org.clojure/clojurescript 0.0-927] ClojureScript compiler and core
runtime library.
(...)
[org.clojure/clojurescript 0.0-1576] ClojureScript compiler and core
runtime library.
[org.clojure/clojurescript 0.0-1586] ClojureScript compiler and core
runtime library.
[com.cemerick/clojurescript.test 0.0.1] Port of clojure.test targeting
ClojureScript.
[rplevy/lein-clojurescript 1.0.2-SNAPSHOT] leiningen plugin for
clojurescript
(...)


On 3/5/13 8:56 AM, Michał Marczyk michal.marc...@gmail.com wrote:

Simplest way is to either search for org.clojure/clojurescript in Central:

http://search.maven.org/#search%7Cga%7C1%7Corg.clojure%2Fclojurescript

or check the name of the latest tag in the repo:

https://github.com/clojure/clojurescript/tags

(the version string is 0.0-N for tag rN).

Also, lein-cljsbuild actually tends to switch to the latest
ClojureScript version as default pretty soon after release.

Cheers,
Michał


On 5 March 2013 14:26, Tom Hall thattommyh...@gmail.com wrote:
 Sure, just add it as an explicit dependency to your project. In fact,
 your example uses r1450 only because you've got an explicit dependency
 on it, as lein-cljsbuild 0.3.0 uses r1552 by default, so you could
 also drop the explicit dependency. It's best to use the latest release
 though.

 Cheers, I must be dumb as I cant see the latest version number on the
 github page.
 Googleing takes me to
 http://mvnrepository.com/artifact/org.clojure/clojurescript/0.0-971
 but im guessing
 http://mvnrepository.com/artifact/org.clojure/clojurescript/0.0-1586
 is the latest

 How is one to find this information out?

 Tom

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send
an email to clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an
email to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: how does one embed nrepl in his own application?

2013-03-05 Thread Weber, Martin S
$ lein new replbuiltin  cd replbuiltin
$ sed -Ee 's,.0,.0][org.clojure/tools.nrepl 0.2.2,'  project.clj  p
 mv -f p project.clj
$ lein deps
$ cat EOF  src/replbuiltin/core.clj
(ns replbuiltin.core
  (:use [clojure.tools.nrepl.server :only [start-server stop-server]]))

(defn foo [x] x)

(defn -main
  I'm showing FooBar how to embed an nrepl!
  [ _]
  (let [repl-server (start-server :port 42042)]
   (Thread/sleep 6)))
EOF

$ lein run -m replbuiltin.core 
$ lein repl :connect 42042
user= (in-ns 'replbuiltin.core)
replbuiltin.core= (foo 42)
42

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Heroku Boot Times

2013-01-23 Thread Weber, Martin S
Obviously it helps to make sure the dependencies you are using are named with 
the exact snapshot version.
The biggest time-saver for me though is convincing lein to not do the 
dependency dance all the time. I'm surprised though to see that you are 
dependency checking at all though. Shouldn't you just create a jar and then 
call directly into that?

Fun observation about reducing lein startup times though:

So I add my deps to the project.clj; use a repo path that is inside the project 
(so it's easier to DCVS it, key :local-repo ); lein deps; run my test cases 
(lein deps sadly does not pull all potentially used dependencies, gotta 
exercise it some); then add :offline? true to the project.clj.

Difference on my old laptop is lein repl: ~20 secs to start with :offline? 
True; without it, it takes 45-50 seconds instead. That's a rough x 2 on a  dual 
core ht 3 Ghz w/ 3G RAM (it's still taking about factor 200 too long, but hey! 
Halved it already! On my work laptop though, the difference is 2 or 4 seconds. 
Not that big of a deal).

Regards,
-Martin

From: Jeroen van Dijk 
jeroentjevand...@gmail.commailto:jeroentjevand...@gmail.com
Reply-To: clojure@googlegroups.commailto:clojure@googlegroups.com 
clojure@googlegroups.commailto:clojure@googlegroups.com
Date: Wed, 23 Jan 2013 12:19:06 -0500
To: clojure@googlegroups.commailto:clojure@googlegroups.com 
clojure@googlegroups.commailto:clojure@googlegroups.com
Subject: Re: Heroku  Boot Times

Hi Scott,

We had some issues as well. SNAPSHOTS are likely to be an issue because they 
are re-checked at least once a day. So if your app needs a restart this will be 
re-checked and might slow down boot time. We also had problems due to this in 
combination with failing maven mirrors. It is probably best to just not use 
SNAPSHOT versions in production.

Another thing that can have impact on boot time is the reading of static files 
on booting. We solved this by using '(def resource (delay (expensive-task ))) 
and @resource to post-pone this execution for after booting.

We also use this feature https://devcenter.heroku.com/articles/labs-preboot/ to 
minimize possible downtime between deploys (not sure if this works for restarts 
as well)

On top of that, we always have a minimum of two dynos for redundancy if one is 
down.

HTH,
Jeroen



On Wed, Jan 23, 2013 at 5:00 PM, Scott Parker 
scott.p.par...@gmail.commailto:scott.p.par...@gmail.com wrote:
Anyone else running a production website with Clojure in Heroku and
struggling with boot time problems? After digging through our logs
from the past month, I've noticed it's not uncommon to have a dyno
crashed for awhile because of boot time problems. It seems especially
likely when dynos are cycling once/day - I'm guessing because of
additional delays in picking up latest snapshot dependencies.

Has anyone else run into this problem and has a bright idea? I have
already verified we're using lein compile :all at deploy (by virtue of
being on lein2), running in the production profile, and I am working
on removing those snapshot dependencies. I've checked the app for
obvious bottlenecks like web/DB/IO requests during initialization with
no luck. We don't have a ton of code or dependencies right now, so I'm
a bit skeptical that we can remain on Heroku as we grow. As a last
resort, I suppose we could try a proxy bound to a Unix socket as in
https://github.com/dblock/heroku-forward but I'd rather avoid that if
possible.

If not advice specifically in the context of pleasing Heroku, advice
on troubleshooting slow app init times generally would also be
welcome. I've done some minimal code benchmarking in Clojure
previously, but never specifically towards resolving time-to-init.

Thanks,
-SP

--
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to 
clojure@googlegroups.commailto: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.commailto:clojure%2bunsubscr...@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.commailto: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.commailto: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, 

RE: edn

2012-09-07 Thread Weber, Martin S
(sorry for top-posting)

Languages have random access / sequential data structures.

Sure. Languages. This is a data format, not a language. Why should I not 
inflate a edn-list into a vector in my language? What if I don't have a random 
access thing handy (because, e.g., I only have trees/tables, as e.g. tcl where 
arrays are actually hashtables with integer keys)? Please do read my post 
again. I'm aware of the clojure link etc. etc. etc. We're talking about a data 
format here.

Regards,
-Martin


From: clojure@googlegroups.com [clojure@googlegroups.com] On Behalf Of Sean 
Corfield [seancorfi...@gmail.com]
Sent: Friday, September 07, 2012 18:44
To: clojure@googlegroups.com
Subject: Re: edn

On Thu, Sep 6, 2012 at 8:26 PM, Weber, Martin S martin.we...@nist.gov wrote:
 The question that's left for me is: why vectors and lists? I mean, from a 
 data format perspective, and a non-clojure implementor, I'm not sure the 
 distinction makes sense. After all for the _data format_, in its serialized 
 form, the vector will not be a random access structure. It has to be 
 deserialized, and access to an element will have linear time complexity. 
 Again, I understand its relevance from the clojure perspective. Is this just 
 too important for edn's current implementor, clojure ?

I think it's a useful hint to allow sequences of data that can be
inflated into data structures supporting random access in constant
time vs those that don't. Many languages have both list-like
collections AND array-like collections.
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

--
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: edn

2012-09-06 Thread Weber, Martin S
which problem other than NIH is edn solving? - given it's a subset of 
clojure's data notation, it's not really native clojure either, so you gotta 
convert to/fro.
So: Why do we need another JSON? 

I'm sure you have answers to these questions, possibly answered them before, 
but definitely not answered them on the edn page.

Regards,
-Martin Weber

-- 
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: edn

2012-09-06 Thread Weber, Martin S
Rich:
 On Sep 6, 2012, at 9:10 PM, Weber, Martin S wrote:
  which problem other than NIH is edn solving? - given it's a subset of 
  clojure's data notation, it's not really native clojure either, so you 
  gotta convert to/fro.
 Of course it's native Clojure. Being a subset doesn't affect that. Clojure 
 can read/print it without conversion.

Of course. For some data.But subset means there is clojure data that it 
cannot represent. 
Thus even though the data that it can represent will not have to be converted, 
the data it 
cannot, will have to be. To determine which data can or can not be represented, 
each piece 
of data must be tested for whether or not it lies in this subset. Which means 
that you cannot 
blindly write out any clojure data. Then you read it and will want to 
reconstruct your 
representation of that data that did not lie in the subset. The tagged literals 
might completely 
take care of that. But this is not the same level of nativeness than printing 
out an integer
and reading it back in.

If you're going to establish a new alternative, why not go for the whole cake. 
I assume this
question will be answered by the rationale.

  So: Why do we need another JSON?
 
  I'm sure you have answers to these questions, possibly answered them 
  before, but definitely not answered them on the edn page.
 
 Correct, there isn't yet a rationale on that page. Coming soon.

Looking forward to that.

Regards,
-Martin

-- 
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: edn

2012-09-06 Thread Weber, Martin S
 Please don't use edn if you don't see the point. I'm not trying to convince 
 you or anyone else.

I expect there to be a point, and thus also expect it to be communicatable. If 
there wasn't
a point, you wouldn't have chosen to use it in datomic, or create the page. I 
feel you haven't
communicated the point adequately yet, which is why I raised the questions I 
raised, also as
a sign to you that these questions do exist. As I wrote, I look forward to 
reading the rationale.
It's not you who needs to convince me (or anybody), it's edn that needs to. 
If it cannot convince
anyone, you're wasting your time. I don't expect you to waste your time. Thus, 
I expect edn
to be able to convince me, once it gets its point across. And I will refrain 
from further comments
until I've seen that argument edn makes for itself.

Regards,
-Martin

-- 
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: edn

2012-09-06 Thread Weber, Martin S
Stu:
 The rationale appears to be up now, and for my money, it is quite clear: JSON 
 not powerful enough, Clojure does too much and is a burden for implementers.
 That said, I won't complain if somebody happens to implement full Clojure 
 serialization while implementing edn. ;-)

The question that's left for me is: why vectors and lists? I mean, from a data 
format perspective, and a non-clojure implementor, I'm not sure the distinction 
makes sense. After all for the _data format_, in its serialized form, the 
vector will not be a random access structure. It has to be deserialized, and 
access to an element will have linear time complexity. Again, I understand its 
relevance from the clojure perspective. Is this just too important for edn's 
current implementor, clojure ?

Regards,
-Martin

-- 
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: Why cannot last be fast on vector?

2012-06-29 Thread Weber, Martin S
I'm sorry to say, but IMHO you failed to communicate the critical point to
your audience. If your audience keeps failing to grasp the point, and
communicates this failure back by asking the same question..

I do understand the distinction between a collection and a sequence and
something being a collection or a sequence operation. That doesn't stop
certain sequences from being capable of doing certain things in a better
way. I simply do not understand the reason of clojure/rich/whoever
throwing away a potential performance increase because this operation
does not operate on the correct level to be performant. If you expect this
to be performant, rewrite it on a lower level. That stance seems
surprisingly patronizing.

Also, it seems of course clojure itself is inconsistent with regard to
that design choice. At least looking at Timothy Baldridge's reply to
possible bug in reducer code makes me think so. I mean come on, a high
level operation being optimized on certain types? Heresy!

Regards,
-Martin


-- 
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: partition-distinct

2012-03-29 Thread Weber, Martin S
Yeah I don't like that either. Consider (comp vals (partial group-by
identity)).

On 2012-03-29 16:18 , David Jagoe davidja...@gmail.com wrote:

Hi all,
I'm sure I'm missing a really simple way of doing this!

Given a sequence like this: [1 2 1 2 1 1 2 1 2 2 2]

partition it to get this: [(1 2) (1 2) (1) (1 2) (1 2) (2) (2)]

I've been trying to write something generic like partition-by because the
values are maps. Also I want to be able to deal with more than 2 distinct
values.

Thanks!

-- 
David Jagoe

davidja...@gmail.com
+447535268218




-- 
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: partition-distinct

2012-03-29 Thread Weber, Martin S
Meh. Half-assed (mis)reading. Sorry. -Martin

On 2012-03-29 16:23 , Weber, Martin S martin.we...@nist.gov wrote:

Yeah I don't like that either. Consider (comp vals (partial group-by
identity)).

On 2012-03-29 16:18 , David Jagoe davidja...@gmail.com wrote:

Hi all,
I'm sure I'm missing a really simple way of doing this!

Given a sequence like this: [1 2 1 2 1 1 2 1 2 2 2]

partition it to get this: [(1 2) (1 2) (1) (1 2) (1 2) (2) (2)]

I've been trying to write something generic like partition-by because the
values are maps. Also I want to be able to deal with more than 2 distinct
values.

Thanks!

-- 
David Jagoe

davidja...@gmail.com
+447535268218




-- 
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: How to escape a space in a keyword?

2012-03-06 Thread Weber, Martin S
I was looking for something akin common lisps |weIrD SymBol!`| already,
too...

On 2012-03-06 15:28 , Frank Siebenlist frank.siebenl...@gmail.com
wrote:

SoŠ spaces are not allowed in symbol and keyword identifiers according to
the specŠ

although Stu doesn't quote the phrase following the allowed chars, which
reads:

(other characters will be allowed eventuallyŠ)

which seems to keep the door open for allowing spaces in the future (?).

If space are not allowed, then it seems we have a bug in (keyword Š) and
(symbol Š),
if they will be allowed in the future, then (pr Š) could/should be
enhanced.

-FrankS.


On Mar 6, 2012, at 12:13 PM, Stuart Halloway wrote:

 I don't think you're supposed to use spaces in keywords.
 
 
 Using spaces in keywords is completely valid, as is using spaces in
 symbols. 
 
 Legal characters in keywords and symbols are documented at
http://clojure.org/reader :
  
 Symbols begin with a non-numeric character and can contain
alphanumeric characters and *, +, !, -, _, and ? ... Keywords are like
symbols ...
 
 Stu
 
 
 
 
 -- 
 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: Weird issue with :require in clojurescript

2012-03-05 Thread Weber, Martin S
Then both Clojure and ClojureScript's `ns` macro should complain about
multiple present (:require ..) or (:use ..) forms at compile-time. At lest
Clojure's `ns` macro doesn't do that on clj-1.3.

Regards,
-Martin

On 2012-03-05 17:15 , Stuart Sierra the.stuart.sie...@gmail.com wrote:

Yes, it is incorrect, in both Clojure and ClojureScript, to repeat the
(:require ...) or (:use ...) forms in an `ns` declaration.
-S


On Monday, March 5, 2012 12:26:03 PM UTC-5, Aaron wrote:
It seems that when I require two namespaces in a namespace definition,

the clojurescript compiler misses the first require.  I have a module

that has a ns definition more or less like the following:


(ns my-namespace

 (:require [lib1 :as l1])

 (:require [lib2 :as l2]))


Using clojurescript master (53ecf3cd3a), the compiled javascript for

the above definition is:


goog.provide('my-namespace');

goog.require('cljs.core');

goog.require('lib2');


The compiler misses the first require.  If I switch the definition

around so that it reads like this:


(ns my-namespace

 (:require [lib2 :as l2])

 (:require [lib1 :as l1]))


again, the compiler misses the first require and the output looks like

this:


goog.provide('my-namespace');

goog.require('cljs.core');

goog.require('lib1');


However, if I just write:

(ns my-namespace

 (:require [lib2 :as l2]

   [lib1 :as l1]))


the javascript output references both libraries just fine.  Is it just

wrong to use multiple requires in clojurescript, or is this really a

bug?  If there is a general convention that must be followed then it

would be good to document it because as a relative new-comer, it took

me a while to find a workaround.


Thanks!






-- 
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