Hired a monkey to hit random keys on my keyboard, and eventually
figured out how to get the automaton working.
RegExp r = new RegExp(ab(c|d)*);
Automaton a = r.toAutomaton();
String s = abcccdc;
System.out.println(Match: + a.run(s)); // prints: true
(add-classpath
Being a Java trainer for a long time, we talk with students about the
handle-or-declare rule in Java and the two types of exceptions: checked
(declared) and unchecked (runtime). So I prefer using a RuntimeException
because no exception was specified.
On Wed, Dec 10, 2008 at 3:46 AM, Mark Volkmann
I note people seem mainly to be using Emacs as an editing/development
environment for Clojure. But as people keep pointing out, Clojure is
homoiconic; the canonical source of a function is not a stream of
bytes read from a file, but is a structure in core.
Now, in-core editing does raise some
Hi Steve,
Thanks for the info. Is this limitation of user.clj arbitrary, or
motivated by some concern that the average Clojure user should know
about? Is the a reason not to load the bindings first? Does user.clj
(in current form) do more harm than good?
Stuart
user.clj is loaded
Here is where I am: If your function creates/returns only atoms or
fixed size collections, loop/recur is fine.
I don't think you should use the word 'atom' in the discussion in the
book. Lisp people will know what you mean, but Clojure's new 'atom'
reference type makes that usage confusing
Stuart Halloway a écrit :
But I bet that isn't the whole story. What are the counterarguments in
favor of non-lazy butlast?
See http://clojure-log.n01se.net/date/2008-06-30.html#22:10b
drop-last has been added to core.clj shortly after.
I guess butlast was a quick expedient to help write
On Dec 10, 7:15 am, Simon Brooke [EMAIL PROTECTED] wrote:
But in-core structure editors are
extremely powerful and useful when editing homoiconic languages, so...
is anyone working on an in-core editor for Clojure?
Not that I've heard, but Emacs + Paredit http://www.emacswiki.org/cgi-
Thanks for confirming the bug, Bill. Should we post this to Jeffrey
Chu (assuming it's a swank-clojure issue)? What's the protocol at
this point?
-Matt
On Dec 9, 11:03 pm, Bill Clementson [EMAIL PROTECTED] wrote:
Hi Matt,
On Tue, Dec 9, 2008 at 6:43 PM, MattyDub [EMAIL PROTECTED] wrote:
Hi Matt,
Yes, you should let Jeffrey know about the bug.
- Bill
On Wed, Dec 10, 2008 at 9:20 AM, MattyDub [EMAIL PROTECTED] wrote:
Thanks for confirming the bug, Bill. Should we post this to Jeffrey
Chu (assuming it's a swank-clojure issue)? What's the protocol at
this point?
-Matt
On
I've created a new Clojure intro at
http://en.wikibooks.org/wiki/Learning_Clojure.
While Rich's screencasts and reference docs are great, they don't
always lay things out in a digestible order. My intro is meant as a
sequential tour through the essential concepts, not a practical
tutorial. In
Hi all,
I am relatively new to clojure. I am trying to port some toy code I
wrote for common lisp a few years ago (a boggle-like game which needs
a dictionary prefix trie to trim possible word matches).
My old code was fairly imperative in nature when creating the
dictionary trie, and so now I
On Wednesday 10 December 2008 10:40, Daniel Eklund wrote:
Hi all,
...
One thing I immediately ran up against were certain situations where
I have a map and want to modify a value several levels deep into
the hierarchy. Imagine the following structure:
(def nested-structure { :level 0,
On Dec 10, 2008, at 8:51 AM, Stuart Halloway wrote:
Thanks for the info. Is this limitation of user.clj arbitrary, or
motivated by some concern that the average Clojure user should know
about? Is the a reason not to load the bindings first? Does user.clj
(in current form) do more harm than
On Dec 10, 2008, at 1:50 PM, Stephen C. Gilardi wrote:
- I think init.clj and repl-init.clj would be good additions to what
we have now. I'll be happy to write the code if it's welcome.
Alternatively, we could make those hooks be functions that one can
(optionally) define in user.clj. The
On Wed, Dec 10, 2008 at 1:40 PM, Daniel Eklund [EMAIL PROTECTED] wrote:
user (path-rebind nested-structure [:nested1 :nested2 :final-data]
new data)
{:nested1 {:nested2 {:final-data new data, :level 2}, :level
1}, :level 0}
Congratulations, you've implemented 'assoc-in' :-)
user=
One thing I immediately ran up against were certain situations where
I have a map and want to modify a value several levels deep into
the hierarchy. Imagine the following structure:
(def nested-structure { :level 0,
:nested1 { :level 1,
user (path-rebind nested-structure [:nested1 :nested2 :final-data]
new data)
{:nested1 {:nested2 {:final-data new data, :level 2}, :level
1}, :level 0}
Congratulations, you've implemented 'assoc-in' :-)
user= (assoc-in nested-structure [:nested1 :nested2 :final-data] new data)
On Wed, Dec 10, 2008 at 2:13 PM, Daniel Eklund [EMAIL PROTECTED] wrote:
As an off-hand comment made without careful reading, I can imagine
there being great utility in a special reader-syntax for paths. XSLT
embeds xpath, and groovy embeds gpath. I am unsure at this point the
exact
On Wed, Dec 10, 2008 at 2:08 PM, Stephen C. Gilardi [EMAIL PROTECTED] wrote:
Alternatively, we could make those hooks be functions that one can
(optionally) define in user.clj. The platform entry point would call them if
they exist:
(ns user)
(defn init
[]
(set! *compile-path*
I've been working on learning Clojure after taking a course in Common
Lisp and I am having some troubles translating a particular Common
Lisp function to Clojure that uses mapping.
We're defining a function that takes a function and two lists and
applies the function to each two items in the
Hi Matt,
I had a bit of free time this morning, so I looked into this further
and came up with a patch (attached). I've forwarded the patch to
Jeffrey as well, so it should find it's way into swank-clojure in due
course.
Cheers,
Bill Clementson
On Wed, Dec 10, 2008 at 9:57 AM, Bill Clementson
I ran this past Rich and since they are Clojure jobs, he gave me the
green light to post this here:
Thanks!
Eric
Great opportunity to join a dynamic environment and take part in the
development of tools written for the Clojure programming language to
enable us to achieve our vision of
On Wed, Dec 10, 2008 at 8:05 PM, Ryan Neufeld [EMAIL PROTECTED] wrote:
I've been working on learning Clojure after taking a course in Common
Lisp and I am having some troubles translating a particular Common
Lisp function to Clojure that uses mapping.
We're defining a function that takes a
Oops, that patch had my debugging statements in it. Here's the correct
one to use.
On Wed, Dec 10, 2008 at 11:44 AM, Bill Clementson [EMAIL PROTECTED] wrote:
Hi Matt,
I had a bit of free time this morning, so I looked into this further
and came up with a patch (attached). I've forwarded the
On Wed, Dec 10, 2008 at 1:27 PM, Brian W [EMAIL PROTECTED] wrote:
Another issue I had is we don't have a good blanket term for Vars,
Refs, Agents, and Atoms. Rich sometimes calls them reference types,
but that term already has a different meaning in Java. I considered
meta-references, but
On Dec 10, 2008, at 3:00 PM, Michael Wood wrote:
The problem seems to be that you are quoting the +. Not sure why
this is, but:
user= ('+ 1 4)
4
('+ 1 4) is effectively (get 1 '+ 4)
(doc get)
-
clojure.core/get
([map key] [map key not-found])
Returns the value
On Wednesday 10 December 2008 10:27, Brian W wrote:
I've created a new Clojure intro at
http://en.wikibooks.org/wiki/Learning_Clojure. ...
...
Another issue I had is we don't have a good blanket term for Vars,
Refs, Agents, and Atoms.
Speaking of these, your article mentions and describes
Seems like having something like this would be a good step towards
supporting image-based development similar to Smalltalk. Whether that
is a good thing or not is a different discussion ;)
-Scott Fleckenstein
On Dec 10, 8:16 am, Stuart Sierra [EMAIL PROTECTED] wrote:
On Dec 10, 7:15 am, Simon
Could you describe in-core editing a bit more? Sounds interesting.
On Dec 10, 7:15 am, Simon Brooke [EMAIL PROTECTED] wrote:
I note people seem mainly to be using Emacs as an editing/development
environment for Clojure. But as people keep pointing out, Clojure is
homoiconic; the canonical
On Wed, Dec 10, 2008 at 3:35 PM, Chouser [EMAIL PROTECTED] wrote:
It's by no means emacs *or even vim* yet
Ouch, that hurts ;)
- J.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post to this
On Wed, Dec 10, 2008 at 4:01 PM, J. McConnell [EMAIL PROTECTED] wrote:
On Wed, Dec 10, 2008 at 3:35 PM, Chouser [EMAIL PROTECTED] wrote:
It's by no means emacs *or even vim* yet
Ouch, that hurts ;)
I'm a vim user, but although I don't envy the multitude of
configuration issues it sound
Hi Matt,
On Wed, Dec 10, 2008 at 12:47 PM, MattyDub [EMAIL PROTECTED] wrote:
I can confirm that that patch fixed my problem - I can now M-. to
render-place. Thanks, Bill!
Good to hear that the patch fixes the issue for you.
What paths does slime-edit-definition search for the
On Wed, Dec 10, 2008 at 2:10 PM, Randall R Schulz [EMAIL PROTECTED] wrote:
On Wednesday 10 December 2008 10:27, Brian W wrote:
I've created a new Clojure intro at
http://en.wikibooks.org/wiki/Learning_Clojure. ...
...
Another issue I had is we don't have a good blanket term for
On Wed, Dec 10, 2008 at 4:06 PM, Chouser [EMAIL PROTECTED] wrote:
I'm a vim user, but although I don't envy the multitude of
configuration issues it sound like emacs/slime/swank users seem to
have, I'm certainly a bit envious of the deep integration between repl
and editor.
I wish Gorilla
A Java reference type is basically any type allocated on the heap. The
four Clojure reference types are particular Java reference types. My
complaint is this is exactly the sort of weirdness that causes
learners to scratch their heads. Not the biggest issue, sure, but this
sort of thing is nice
Thats the CL'ism I was hanging on to! Thanks for the amazing and
prompt replies.
On Dec 10, 1:59 pm, Dean Ferreyra [EMAIL PROTECTED] wrote:
Ryan Neufeld wrote:
I've been working on learning Clojure after taking a course in Common
Lisp and I am having some troubles translating a particular
On Wed, Dec 10, 2008 at 4:10 PM, J. McConnell [EMAIL PROTECTED] wrote:
On Wed, Dec 10, 2008 at 4:06 PM, Chouser [EMAIL PROTECTED] wrote:
I'm a vim user, but although I don't envy the multitude of
configuration issues it sound like emacs/slime/swank users seem to
have, I'm certainly a
On Wed, Dec 10, 2008 at 4:32 PM, Brian Will [EMAIL PROTECTED] wrote:
A Java reference type is basically any type allocated on the heap. The
four Clojure reference types are particular Java reference types. My
complaint is this is exactly the sort of weirdness that causes
learners to scratch
On Dec 10, 12:07 pm, Michael Wood [EMAIL PROTECTED] wrote:
OK, I think I know why this happens. It's treating the '+ as the key
for a map, and using the second integer as the default value. I'm not
sure why it treats an integer as a map, though:
Wow, that's a bit of a gotcha. It's not
On Wed, Dec 10, 2008 at 12:45 AM, J. McConnell [EMAIL PROTECTED] wrote:
On Tue, Dec 9, 2008 at 7:05 PM, Rich Hickey [EMAIL PROTECTED] wrote:
Thanks. I think it does a bit too much - I only want to relax the
requirement for namespace-qualification, not any of the other
assertions (e.g. that
Hi,
I got this message from Feng, thank you very much. Posting for future
reference.
Feng to me:
swank-clojure had some major change since then. If you use latest git
clone, you should replace swank/create-server with,
(swank/start-server /dev/null :port 4005 :dont-close true)
/dev/null
Sorry for starting a new thread, this should go to swank-clojure
thread,
I should get some sleep.
http://groups.google.com/group/clojure/browse_thread/thread/793cf6e179db3752
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Hi Brian,
Looks really good.
My intro is meant as a
sequential tour through the essential concepts, not a practical
tutorial. In particular, my examples are deliberately cursory and
abstract, and my API coverage is very minimal.
I have some comments which may go beyond your desired scope,
On Dec 10, 2008, at 9:03 PM, Brian Will wrote:
btw, you'll see a few notes I left in the text in square brackets
where I wasn't sure on some point. If someone could address those
questions, I'd appreciate it.
[hmm, what are the chances of a false positive due to hash
collision? are the
Tim:
Rich talks about destructuring in the part about let on the special
forms page.
The discussion of functions and basic syntax is deliberately delayed
because of dependencies, e.g. evaluation can't really be understood
without understanding the reader, and explaining the reader involves
On Dec 10, 3:59 pm, falcon [EMAIL PROTECTED] wrote:
Could you describe in-core editing a bit more? Sounds interesting.
+1
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Clojure group.
To post to this group,
On Dec 10, 2008, at 4:38 AM, Ralf Bensmann wrote:
Being a Java trainer for a long time, we talk with students about
the handle-or-declare rule in Java and the two types of
exceptions: checked (declared) and unchecked (runtime). So I
prefer using a RuntimeException because no exception was
Some Noobian critique:
Thread-local bindings also allow us to monkey-patch for the span of a local
context. Say we have a function *cat* which calls a function stored in a
Var; if a function *goat* is root-bound to the Var, then *cat* will
normally call *goat*; however, if we call *cat* in a
Hi Matt,
FYI - Jeffrey Chu just sent me an email and the patch has now been
applied to swank-clojure.
- Bill
On Wed, Dec 10, 2008 at 1:09 PM, Bill Clementson [EMAIL PROTECTED] wrote:
Hi Matt,
On Wed, Dec 10, 2008 at 12:47 PM, MattyDub [EMAIL PROTECTED] wrote:
I can confirm that that patch
I'm trying to generate a Java class from Clojure with gen-class, but
without much success. I've got the following code:
(ns p.C (:gen-class :methods [[m [Object] void]]))
(defn -m [o] (println (.. o getClass getName)))
The signature of the m method is correct:
javap p.C
public class p.C
Not sure about the other info you're looking for, but I think I can help
explain what's going on. All methods have an extra argument passed in
representing the object itself (usually called this).
In your example, what you want is:
(ns p.C (:gen-class :methods [[m [Object] void]]))
(defn -m [this
Of course! Thanks a lot!
On Dec 11, 7:23 am, Chris Turner [EMAIL PROTECTED] wrote:
Not sure about the other info you're looking for, but I think I can help
explain what's going on. All methods have an extra argument passed in
representing the object itself (usually called this).
In your
52 matches
Mail list logo