Re: Empty list type

2011-11-01 Thread Chouser
something for which seq?, list?, coll?, and sequential? will return true, and that () and (list) will return something for which empty? will return true. --Chouser -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send ema

Re: Let usage question

2010-10-28 Thread Chouser
onger be safely cleared." This is dramatically better than the "invisible" head-holding that sometimes happened in earlier versions of Clojure (and was noted in earlier versions of JoC), but is still good to be aware of. --Chouser http://joyofclojure.com/ -- You received this mess

Re: clojure -> javascript

2010-12-21 Thread Chouser
On Tue, Dec 21, 2010 at 6:51 AM, Shane Daniel wrote: > Hi everybody, > Just for kicks I took Chouser's good start on the PersistentVector port and > threw it in a Github gist, and demonstrated using it in jsFiddle. I love the > cloud these days ;) > Anyway, I hope you don&#x

Re: Error Handling for Callback API to Blocking API example in Joy of Clojure

2010-12-21 Thread Chouser
On Sun, Dec 19, 2010 at 3:36 AM, HiHeelHottie wrote: > > In Joy of Clojure, there is a callback API to blocking API example in > the section on promises.  Chouser outlines it a briefly in a > discussion on Promise/Deliver use cases here - > http://groups.google.com/group/clojur

Re: a loop gives boxing warning when it shouldn't

2011-01-03 Thread Chouser
On Sat, Jan 1, 2011 at 5:47 PM, Albert Cardona wrote: > Hi all, > > I'd apreciate help on figuring out why a loop gets number boxing > warnings, when it shouldn't: > > http://clojure.pastebin.com/9uLZqGhy I just filed this as: http://dev.clojure.org/jira/br

Re: Testing if a sequence is lazy

2011-01-19 Thread Chouser
uld change at any time, probably fails in various spectacular ways. Use at your own risk. :-) http://gist.github.com/589694 --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email t

Re: Efficient queue types for Clojure.

2011-01-22 Thread Chouser
noting that > it's not truly O(1). Clojure's sorted collections are binary trees thus log2, not log32 like the hashed collections. --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to th

Re: Problems with lazy-xml

2011-02-11 Thread Chouser
On Fri, Feb 11, 2011 at 2:35 PM, Chris Perkins wrote: > On Feb 11, 5:07 am, Marko Topolnik wrote: >> http://db.tt/iqTo1Q4 >> >> This is a sample XML file with 1000 records -- enough to notice a >> significant delay when evaluating the code from the original post. >&

Re: Problems with lazy-xml

2011-02-12 Thread Chouser
t want it. The drop-last is used because the last node of each interior sequence holds the non-descendant events and so must be dropped from the content seq. I'm currently trying to come up with a different way of passing around the non-descendant events so that drop-last isn't neces

Re: Clojure on JS VMs

2011-03-03 Thread Chouser
I'm sorry it's too out of date to be of much real use now, but it does show it's possible and hopefully has some tidbits that will be useful in later implementations. --Chouser http://joyofclojure.com/ -- You received this message because you are subscribed to the Google Groups &q

Re: Comparing clojure speed to java speed

2011-03-11 Thread Chouser
aren't useful. In which case I'd recommend leaving them out. --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

Re: Binding dynamically created symbols in the lexical context.

2008-08-24 Thread Chouser
at runtime, not when the macro is evaluated. This means I think we ought to be able to make the match macro emit the appropriate code to have the same behavior as the eval, but without any eval at all. --Chouser --~--~-~--~~~---~--~~ You received this message

Re: Binding dynamically created symbols in the lexical context.

2008-08-24 Thread Chouser
p a solution. Would this be possible? --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 To unsubscribe from this group, sen

Re: Porting Scala example to Clojure

2008-08-25 Thread Chouser
] color :when (not= v 0)] k)) Maybe others can spot more simplifications. > (defmulti color-string basic-colors-in) I don't feel qualified to comment on this use of multimethods, or multimethods at all really. I simply wouldn't have thought of using them in this case, but

Re: Porting Scala example to Clojure

2008-08-25 Thread Chouser
On Mon, Aug 25, 2008 at 9:16 AM, Chouser <[EMAIL PROTECTED]> wrote: > On Mon, Aug 25, 2008 at 8:45 AM, Stuart Halloway > <[EMAIL PROTECTED]> wrote: >> >> (defn keys-with-value-matching [map test-fn] >> (for [pair (map identity map) :when (test-f

Re: doseq appearance

2008-08-25 Thread Chouser
On Mon, Aug 25, 2008 at 11:09 AM, Rich Hickey <[EMAIL PROTECTED]> wrote: > > Unfortunately, this would be a breaking change Does that mean it's off the table, or just postponed until some future "major" release? --Chouser --~--~-~--~~~---

Re: doseq appearance

2008-08-25 Thread Chouser
(= 0 (rem i j))] (println i j) --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 To unsubscribe from this group,

Re: idiomatic way of creating a set of records

2008-08-25 Thread Chouser
don't like the new names I picked, feel free to pick new ones. :-) --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

Re: Binding dynamically created symbols in the lexical context.

2008-08-26 Thread Chouser
s now work: user=> (match '(1 2 3) (a b c) (list c b a)) (3 2 1) user=> (let [z 4] (match '(1 2 3) (a b c) (list z c b a))) (4 3 2 1) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: shuffle vector in Clojure

2008-08-26 Thread Chouser
(merge-with + results {(shuffle coll) 1})) {} (range n))] (doseq r results (println (key r) ":" (val r)) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: shuffle vector in Clojure

2008-08-27 Thread Chouser
[(keyfn x) x]) coll)] (map second (sort key-vals) It's still no match for shuffle-java, though. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Re: updating nested structure

2008-08-27 Thread Chouser
/2008-07-15.html#09:22 I had forgotten that when I brought it up again today: http://clojure-log.n01se.net/date/2008-08-27.html#10:00 It seems to me you're already pretty close to what Rich wants. --Chouser --~--~-~--~~~---~--~~ You received this message bec

Re: updating nested structure

2008-08-27 Thread Chouser
ise. apply actually can do the conj'ing for you: (apply mk-get my-fridge (item-path :mango) :quantity) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: updating nested structure

2008-08-28 Thread Chouser
On Thu, Aug 28, 2008 at 2:01 AM, Parth Malwankar <[EMAIL PROTECTED]> wrote: > > On Aug 28, 8:13 am, Chouser <[EMAIL PROTECTED]> wrote: >> >> (apply mk-get my-fridge (item-path :mango) :quantity) > > I get an error with this. > > user=> (item-path :man

Re: Clojure Robustness

2008-09-03 Thread Chouser
available to help, or any bug in Clojure that is too large or unpredictable that you'd have any trouble working around. As you said, your runtime environment is really just the JVM, so if that's safe enough for you, you should be good to go. --Chouser --~--~-~--~~---

Re: clojure/ns and gen-and-save-class

2008-09-03 Thread Chouser
uot;load-resources". I think > we should consider changing the name of the former to something else like > "load-reader" and using "load" for what is now load-resources (and :load for > what is now :load-resources). I have no objection to this. --Chouser --~--~

Re: clojure/ns and gen-and-save-class

2008-09-03 Thread Chouser
ussion. If we settle on any alternate solution, this patch can just be ignored. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegr

Re: clojure/ns and gen-and-save-class

2008-09-04 Thread Chouser
ly any harm in re-refering 'clojure if ns (or defns) is run a second time on the same namespace? --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

Re: JRuby article highlights some possible acceptance issues for Clojure

2008-09-06 Thread Chouser
to all of Java, but has more libs than lisp and that's more dynamic than java is *way* cool. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

Re: new ns macro, excluding clojure fns?

2008-09-06 Thread Chouser
ough exactly what isn't clear. Stay tuned. --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 To unsubscribe from thi

Re: clojure/ns and gen-and-save-class

2008-09-06 Thread Chouser
s works fine # user=> I've updated zip-filter and mmap in clojure.contrib to use the new format. I like it. It's such a relief to be able to rely on the availability of lib.clj goodness, and the ns macro is a very pleasant way to use it. --Chouser --~--~-~--~~

re-split

2008-09-08 Thread Chouser
h to re-split to replace the existing one? Otherwise, what would be a good name for it? Here's the implementation: (defn re-split [#^java.util.regex.Pattern re #^CharSequence cs] (let [m (re-matcher re cs)] ((fn step [prevend] (if (.find m) (lazy-cons (.su

Re: clojure -> javascript

2008-09-09 Thread Chouser
, v.nth( i ), v.assocN( i, val ), v.count(), etc. The only create method I wrote takes a JS array: PersistentVector.create( ["a", "b", "c"] ) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Re: string-split, help me make it a string again :)

2008-09-10 Thread Chouser
f" "asdf" "asg") > btw, anyone know how to set default intendation to 4 chars instead of > 2? :set sw=4 That's for vim. You are using vim, aren't you? :-) --Chouser --~--~-~--~~~---~--~~ You received this messa

Re: Clojure Poll 09/2008

2008-09-11 Thread Chouser
I am using > functions returning true on matching vectors and for creating > conditions i use a macro. It's fun but hard to get right. Sounds similar to clojure.set: (doseq [n v] (ns-publics (find-ns 'clojure.set)) (print-doc v)) --Chouser --~--~-~--~~~---~--~

Re: re-split

2008-09-12 Thread Chouser
's partition-by (in clojure.contrib.seq-utils). Works for me -- added. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroup

Re: Clojure Poll 09/2008

2008-09-12 Thread Chouser
_SOURCE_FILE:97: Unable to resolve symbol: yoink in this context The key part being: NO_SOURCE_FILE:97 Obviously there's no source file at the repl, but this was apparently the 97th line I've entered in this repl. --Chouser --~--~-~--~~~---~--~~ You

Re: Clojure Poll 09/2008

2008-09-16 Thread Chouser
there is also ; and documentation strings stored as meta-data attached to function vars. boot.clj has all but the first of these. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: "Getting Started" is NOT starting for me...

2008-09-19 Thread Chouser
ime Environment (build 1.6.0_07-b06) Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send em

lazy apply and multimethods

2008-09-25 Thread Chouser
ot; So good so far -- the r argument works as expected. But if we give it an infinite sequence, it gets stuck in an infinite loop: user=> (apply z (iterate inc 0)) ; never comes back You have been warned. :-) --Chouser --~--~-~--~~~---~--~~ You received this mess

Re: Self-referential proxies

2008-09-27 Thread Chouser
erExec(TIMER_INTERVAL, this); > } >}; >display.timerExec(TIMER_INTERVAL, runnable); Clojure functions implement Runnable, so you ought to be able to do something like: (defn my-run [] (animate) (.timerExec display *timer-interval* my-run)) (.timerExec display *timer-interval* my-run) That&#x

Re: On Lisp -> Clojure

2008-09-30 Thread Chouser
f aset. For more details on refs, see http://clojure.org/refs Anyway, don't let me discourage you -- I'm sure working through On Lisp will be a great way for you to learn Clojure, and will likely help others too. I'm very interested to see the DSLs of the later chapters in Cloju

Re: CL conditions, exceptions, stack walking, ...

2008-09-30 Thread Chouser
; now retval=8, side-x=3, side-y=nil (prn :retval retval) (prn :side-x side-x) (prn :side-y side-y))) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

clojure.lang class inheritance graph

2008-10-02 Thread Chouser
I made one of these before, but here's an updated version: http://clojure.googlegroups.com/web/chart.png The code that generated it is attached. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &qu

Re: clojure.lang class inheritance graph

2008-10-03 Thread Chouser
with suggestions or fully-completed libraries, that'd be great too. :-) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegro

Re: class weirdness

2008-10-03 Thread Chouser
it in x in your example. So that's convenient, but sometimes you need to force it a bit, by doing something like (.getName (identity Integer)) See also: http://clojure-log.n01se.net/date/2008-09-06.html#09:26 http://clojure-log.n01se.net/date/2008-08-28.html#21:42 http://gr

stack overflow in "for"

2008-10-03 Thread Chouser
e. Having "for" use "recur" instead of "lazy-cat" in such cases seems to fix the problem. Patch is attached. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cloju

Re: how to call java class member's method in clojure?

2008-10-05 Thread Chouser
field of System, so System/out (.println System/out "hello world") --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroup

Re: any? function

2008-10-05 Thread Chouser
-- clojure/some ([pred coll]) Returns the first logical true value of (pred x) for any x in coll, else nil. It's not identical to yours, as it returns whatever pred returned, instead of always returning true. --Chouser --~--~-~--~~~---~--~~ You receiv

genclass error message

2008-10-06 Thread Chouser
ched is a patch to change this error to: Exception in thread "main" java.lang.UnsupportedOperationException: net.n01se/TestObj-main not defined --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &qu

regex literal syntax

2008-10-07 Thread Chouser
"\"" or #"\\\"" (but #"\\"" blows up the reader) 10. #"" (but #"\\" is illegal) 11. #"\\(" (but #"\(" is illegal) Somehow I'm not sure that communicates how much I dislike the current syntax. Oh well, maybe

Re: regex literal syntax

2008-10-07 Thread Chouser
ipt, where \a means a plain letter a instead of ASCII 7). If instead you escape things the way you currently have to in Clojure, many of the expressions don't work or mean something different in the other languages. In other words, under the proposed syntax Clojure regex literals

Re: two dimensional arrays

2008-10-07 Thread Chouser
te 8 nil)) board (vec (replicate row 8))] (assoc board 1 (assoc (board 1) 5 "black pawn"))) If you're really sure you want a non-thread-safe mutable Java array, you can get an 8x8 array of Objects: (make-array Object 8 8) --Chouser --~--~-~--~~~---~--

Re: regex literal syntax

2008-10-08 Thread Chouser
lied to a new dispatch macro. One option would be something like #r/foo/ that would allow your choice of delimiters to further reduce the need for back-slash quoting within the regex. --Chouser --~--~-~--~~~---~--~~ You received this message because you are s

Re: GUIs in Clojure

2008-10-08 Thread Chouser
)) (.addMouseListener table (proxy [MouseAdapter] [] (mouseClicked [e] (when (== (.getClickCount e) 1) (let [p (.getPoint e) r (.rowAtPoint table p) c (.columnAtPoint table p)] (prn "click row " r) (flush)) --Chouser -

Re: gen-class and namespace

2008-10-08 Thread Chouser
lve the problem by putting this at the top of Baz.clj: (ns foo.bar (:use foo.bar)) That causes foo/bar/bar.clj to be loaded the first time its needed and not again. Is that what you want? I'm probably misunderstanding the problem, so feel free to

Re: Help going from ruby blocks to clojure sequences.

2008-10-09 Thread Chouser
st, to see if you can think of what new value you're trying to compute rather than thinking about iterating and changing data. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: regex literal syntax

2008-10-09 Thread Chouser
acters because it is a string. I actually prefer " over / as the only allowed delimiter. Matching file paths with / as the delimiter is not uncommon, and rather painful: #/\/usr\/lib\/*.so/ The contexts where " have to be quoted often don't seem quite as bad: #"" --Chouser

Re: regex literal syntax

2008-10-09 Thread Chouser
ys: (Pattern/compile "\"") I think the only cause of trouble is the " char, so the Pattern's string would have to be scanned looking for " and determining if it's already quoted. If quoted, leave it alone; if unquoted, insert a backslash. I'll code it up, unl

Re: regex literal syntax

2008-10-09 Thread Chouser
(cond (= c \\) (do (.append w \\) (.append w #^Character (first r)) (recur (rest r))) (= c \") (do (.write w "\\\"") (recur r)) :else(do (.append w c)

Re: regex literal syntax

2008-10-10 Thread Chouser
On Fri, Oct 10, 2008 at 4:07 AM, Christophe Grand <[EMAIL PROTECTED]> wrote: > > Hello Chouser, (btw, nice work you are doing with ClojureScript) Thanks -- good to see you around again! > Do you plan to support printing of all Pattern instances or only those > created usi

Re: help a journalist: why Clojure?

2008-10-10 Thread Chouser
as Java. Maybe not quite a pithy as you want, but you're the journalist -- you can edit it down, right? :-) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Re: regex literal syntax

2008-10-10 Thread Chouser
On Fri, Oct 10, 2008 at 7:48 AM, Chouser <[EMAIL PROTECTED]> wrote: > > Of course that means I need to do this for you when printing... I've attached an updated patch with a new print method, against the latest SVN 1058. If you really want to dig into the ugliness, here's

Re: Event Listeners in Functional Programming

2008-10-10 Thread Chouser
So what is it you want the button to do? Mutability is no sin, and Clojure gives you tools to manage it. For example the click listener could dispatch an action to an agent, which would allow the GUI to continue promptly while the action works in another thread. Would that be sufficient for w

Re: REPL does not print stack trace in some cases

2008-10-11 Thread Chouser
I recent one, no less. Seriously, people were complaining about giant "meaningless" stack traces at the REPL, so the default now is to just print the exception itself. To get the stack trace after an exception has occurred, try: (.printStackTrace *e) --Chouser --~--~-~--~~

Re: REPL does not print stack trace in some cases

2008-10-11 Thread Chouser
e. If a .clj file loaded from the command line throws an exception, then I see the stack trace, but that's a sort of "batch mode" where I guess people were less unhappy about the long stack trace. --Chouser --~--~-~--~~~---~--~~ You received this m

Re: TransactionalHashMap

2008-10-11 Thread Chouser
clojure.lang.MultiFn.invoke(MultiFn.java:152) at clojure.lang.Var.invoke(Var.java:323) at clojure.lang.RT.print(RT.java:1165) at clojure.lang.Repl.main(Repl.java:88) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

Re: are pr & friends correct for regexps?

2008-10-13 Thread Chouser
On Mon, Oct 13, 2008 at 9:06 AM, Stuart Halloway <[EMAIL PROTECTED]> wrote: > > (prn #"\\w+") > -> \w+ Works for me, SVN 1067: user=> #"\\w+" #"\\w+" user=> (prn #"\\w+") #"\\w+" nil --Chouser --~--~-~--~--

Re: primitive meta data

2008-10-15 Thread Chouser
don't know how useful these kinds of micro-benchmarks really are. Clojure's "fast enough" so let's go solve some interesting problems... --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google G

Re: regex literal syntax

2008-10-15 Thread Chouser
Pattern compile method, so its quoting rules apply instead of the string literal quoting rules. This means that unlike string literals, backslashes in regex patterns do not need to be escaped with another backslash. For example, #"\d*" matches

Re: toUpperCase on java.lang.String

2008-10-15 Thread Chouser
ork, but I pretty much always prefer -> because you can mix in non-methods, and the methods are clearly indicated with a leading dot. In fact, I could imagine lobbying to have .. removed (while we're making breaking changes...) --Chouser --~--~-~--~~~---~--~~

Re: Can macros be used for blunt token-pasting?

2008-10-15 Thread Chouser
fmacro paste-tokens [first second] (list 'def (symbol (str first second)) [])) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloj

Re: clojure.zip/goto proposal

2008-10-16 Thread Chouser
returns its loc. Wouldn't each step of the path have to provide the entire sub-tree at that point, in order for = to return true? How would this be useful? Or am I misunderstanding something? --Chouser --~--~-~--~~~---~--~~ You received this message because y

Re: clojure.zip/goto proposal

2008-10-16 Thread Chouser
zip-seq trees would be used and if there's anything from clojure.contrib.zip-filter that would be useful for navigating those. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" grou

Re: max

2008-10-16 Thread Chouser
"compact" means, so that you can say: (compact coll) instead of: (filter identity coll) ? --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: offtopic - where are you come from? (poll)

2008-10-17 Thread Chouser
On Fri, Oct 17, 2008 at 5:27 AM, Rastislav Kassak <[EMAIL PROTECTED]> wrote: > > So wherever are you come from, be proud and say it. Indiana, U.S.A. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

Re: Bug? Strange set equality (r1075)

2008-10-19 Thread Chouser
On Sun, Oct 19, 2008 at 3:02 PM, Achim Passen <[EMAIL PROTECTED]> wrote: > >user> (= #{1 4} #{2 3}) >true > > it's not, is it? I hope not! Patch attached. --Chouser --~--~-~--~~~---~--~~ You received this message beca

Re: Modified doto

2008-10-21 Thread Chouser
in practice that using doto seems okay at first, but I commonly have to insert a function call eventually, and end up having to change a lot of existing code to get rid of the doto's. This has been painful enough that I've pretty much stopped using doto in code

Re: Modified doto

2008-10-21 Thread Chouser
ough "do-with" or "do->" might be okay. I'd probably vote against "do-unto-others-as" --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post t

Re: Modified doto

2008-10-21 Thread Chouser
", " "World!"])) "Hello, World!" I used it a couple times after first writing it, but have since failed to find much use for it. I guess I wouldn't really recommend it. --Chouser --~--~-~--~~~---~--~~ You received this message

Re: Find lines matching regexp in large text file - performance suggestions welcome

2008-10-21 Thread Chouser
matcher pattern line)) (conj acc [(.getLineNumber r) line]) acc)) [] (take-while identity (repeatedly read-line))) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribe

Re: Reader + Macros on untrusted S Expressions: Security considerations?

2008-10-22 Thread Chouser
functions. Perhaps you'd still want to audit the LispReader.java code for security vulnerabilities and/or run the reader in some sort of Java sandbox, but I wouldn't be surprised if neither of these is actually necessary. --Chouser --~--~-~--~~~---~--~~ You r

Re: Reader + Macros on untrusted S Expressions: Security considerations?

2008-10-22 Thread Chouser
umably it would require an > S-Expression reader written in JavaScript to decode them. > > That would be a nice thing to have. Is anybody aware of one? Or write a JSON writer in Clojure. That would probably run faster and be more fun to create. Although I thin

Re: Data types in Clojure

2008-10-22 Thread Chouser
va code by gen-class and possibly the easier-to-use proxy function. --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.co

Re: Data types in Clojure

2008-10-23 Thread Chouser
k.a. "alias") over the use of "use". By using require, everyone reading your code can quickly spot which lib each function is being imported from, making it much easier to track down docs, implementation, etc. Using "use" is ok too if

Re: Modified doto

2008-10-23 Thread Chouser
s part of the upcoming bit of breaking changes? Under most circumstances you'd get compile errors up front, I think, and those would be simple to fix. Wouldn't bother me. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Strange behavior of the #() macro

2008-10-23 Thread Chouser
27;s possible, but ugly. #(do [%&] 3) Please don't use that. :-) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroup

Re: Clojure and introspection/reflection analysis?

2008-10-23 Thread Chouser
lo_world.lisp and execute > the hello-world call. > > At the command line: > #Inspect: hello-world function was called > #Hello World > #Inspect: hello-world has finished executing. This was asked in IRC, and a couple suggestions were posted: http://paste.lisp.org

take goes too far

2008-10-24 Thread Chouser
ou actually want the fourth value, there's nothing I can do for you. (0 1 hurt me plenty 2 99) Here's "my-take" renamed to "take" for easy patching of boot.clj: http://paste.lisp.org/display/69146 --Chouser --~--~-~--~~~---~--~~ You r

Re: re-def stuff

2008-10-25 Thread Chouser
n support though, so if you've got several inter-dependant functions to replace, make sure you do it in an order that makes sense. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure"

Re: Idiomatic Clojure code?

2008-10-27 Thread Chouser
ns unique values that are in one sequence but not the others." [& seqs] (let [obj-cnt (reduce (fn [acc s] (merge-with + acc (into {} (for [i s] {i 1} {} seqs)] (for [[obj cnt] obj-cnt :when (== cnt 1)] obj))) --Chouser --~--~

Re: Idiomatic Clojure code?

2008-10-27 Thread Chouser
looks like "concat" is lazy also. And now I'm wondering what the difference is between concat and lazy-cat. So anyway, you're right -- lazy-cat may make sense with eager inner funcs in general and in this case in particular. --Chouser --~--~-~--~~~

Re: idiomatic Clojure for agents?

2008-10-27 Thread Chouser
local name can cause surprises later when someone tries to use the clojure/count function. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloju

Re: idiomatic Clojure for agents?

2008-10-28 Thread Chouser
elf using "seq" as an argument name. --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 To unsubscribe fr

Re: Reader + Macros on untrusted S Expressions: Security considerations?

2008-10-29 Thread Chouser
On Wed, Oct 29, 2008 at 9:53 AM, Tom Hickey <[EMAIL PROTECTED]> wrote: > > Chouser, does ClojureScript not have something like this in order to > do read? It doesn't. ClojureScript currently uses the standard Clojure reader and parts of the compiler. This means, for exa

Re: I want to contribute, where can I start?

2008-10-30 Thread Chouser
ame time, and so that we can all offer suggestions and all manner of helpful and unhelpful comments. :-) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: Macro-Defining Macros

2008-11-03 Thread Chouser
ts, "let" locals, etc.) you don't want that, so you need to use some mechanism to make it clear what you mean. One such mechanism is gensym (in this case I used the trailing # which is an auto-gensym). Another option is ~'foo which would explicitly capture "foo" from

Re: (source name)

2008-11-03 Thread Chouser
On Sun, Nov 2, 2008 at 6:34 PM, Mark McGranaghan <[EMAIL PROTECTED]> wrote: > > I really like being able to find and check documentation in the REPL > with find-doc and doc, but I often would like to see the source code > of a function or macro to be able to understand it better or learn > from th

Re: Concerned about Clojure's license choice.

2008-11-03 Thread Chouser
#x27;t we relax a bit until someone has identified an actual concrete benefit of making a license change? --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

Re: Swing GUI Builder and Clojure

2008-11-04 Thread Chouser
esigner" that generates an xml file that can be loaded at runtime. He's a rough example: http://paste.lisp.org/display/69450 --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" grou

<    2   3   4   5   6   7   8   >