Re: dispatch macros that are new to me

2009-01-27 Thread Chouser
> What does #! do? I see in LispReader.java that it uses a > CommentReader. Is it just an alternative for a semicolon? Yes, but it's specifically meant to be used as the first line of a file, to allow Clojure script to use unix "shebang" format. --Chouser --~--~

Re: Length of Sequence

2009-01-28 Thread Chouser
ough the source code and by uses of find-doc. --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 fro

more readable IRefs

2009-01-28 Thread Chouser
matter. user=> (let [a (atom 4)] (swap! a inc) (prn a) (swap! a + 10) (prn a)) # # This is also why the #<> format is still used, disallowing 'read' from working on the string. --Chouser --~--~-~--~~~---~--~~ You received this message becaus

Re: proposal for shell-out: option to return articulated out, err, & exit code

2009-01-28 Thread Chouser
e. > Anyone else have an interest in such a feature? In particular, would > the option be handy for lancet? > > The modified sh function is below for reference, but I'll submit an > issue & patch to contrib if invited to. Please do. --Chouser --~--~-~--~~-

Re: proposal for shell-out: option to return articulated out, err, & exit code

2009-01-28 Thread Chouser
On Wed, Jan 28, 2009 at 4:43 PM, Chouser wrote: > > Sounds good. Is ':verbose' the base name for this option? Sorry for the typo. "best name" --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

Re: nested maps

2009-01-28 Thread Chouser
et a new map where the city is changed? > (update-in person [:employer :address :city] (fn [old & args] "Clayton")) > I can't get this to work with #("Clayton") in place of the anonymous > function above. You might like 'assoc-in' for this use case. --Ch

Re: repeat and replicate

2009-01-28 Thread Chouser
waiting for some hammer to drop about args ordering or > partial application or something... +1 from me, for what it's worth. (repeat obj) and (repeat n obj) look good. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

Re: more readable IRefs

2009-01-28 Thread Chouser
On Wed, Jan 28, 2009 at 5:57 PM, Rich Hickey wrote: > > On Jan 28, 4:11 pm, Chouser wrote: >> >> Now Ref and all her cousins print their values: >> >> user=> (agent 99) >> # > > Patch welcome for this. Created issue with patch: http://code.google

Re: clojure.contrib.command-line patch: multiple option format

2009-01-28 Thread Chouser
, please don't include any commented-out lines in your final patch. Thanks so much for your help, --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send emai

Re: Got a Clojure library?

2009-01-29 Thread Chouser
My name is Chouser, and these are my libs. All are licensed under the EPL. == Category: OS integration == * clojure.contrib.command-line Parses command-line options according to your programs specifications. Provide --help output automatically. * clojure.contrib.shell-out Launch external

Re: Alternatives to contains?

2009-01-29 Thread Chouser
e (some #{:y} [:x :y :z]) idiom? Is it too verbose? Too slow? Too flexible? Too good a re-use of existing functionality? Too helpful in opening ones eyes to the possibilities of sets and higher order functions? And if you really don't want to

Re: newbie Q: can I optimize away like this?

2009-02-01 Thread Chouser
h as possible, while keeping large enough to be correct. One thing I'd be careful about is the use of 'ref-set' there. In a real program it seems rare that a 'ref-set' would stand alone like that. I'd check care

Re: Request for feature: watchers on namespaces

2009-02-01 Thread Chouser
a.util.concurrent.ConcurrentHashMap, so that might be harder to port to a Clojure IRef, if that's even desirable. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: SVN branches

2009-02-02 Thread Chouser
day, mainly about the "lazy" branch: http://clojure-log.n01se.net/date/2009-02-02.html#09:47 --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

Re: Memory Consumption of Large Sequences

2009-02-02 Thread Chouser
Depending on your actual use case, vectors may work well. If you don't need the whole collection at once, perhaps a lazy seq that simply promises the values as they're demanded would work. One of the Map types might be good if your collection is likely to be sparse. Or if none of these

Re: special forms vs. functions and macros

2009-02-03 Thread Chouser
ure/source/browse/trunk/src/jvm/clojure/lang/RT.java#171 --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: rules for writing macros

2009-02-03 Thread Chouser
"^#'" s ==> #'user/mydoc2 (macroexpand '(mydoc2 doc)) ==> (:doc ^#'doc) (mydoc2 doc) ==> java.lang.Exception: Unable to resolve symbol: ^#'doc --Chouser --~--~-~--~~~---~--~~ You received this message becaus

Re: Type hint Java array of your own Java class

2009-02-04 Thread Chouser
oobar [#^#=(array-of MyClass) myarray]) At least it appears to work: user=> (meta #^#=(array-of String) []) {:tag "[Ljava.lang.String;"} Again, I apologize for even suggesting this. --Chouser --~--~-~--~~~---~--~~ You received this message because you

Re: Type hint Java array of your own Java class

2009-02-04 Thread Chouser
this example was to attach type-hint metadata to a function arg, so the use of #^ was necessary. But usually #^ just takes a literal symbol or map, and I wanted to use the results of a function call, so I abused #= to do just that. --Chouser --~--~-~--~~~---~--~-

Re: Indy .NET programmers discover parentheses

2009-02-05 Thread Chouser
> More description and meeting details: > http://indyalt.net/cms/meeting/february-2009/clojure Sounds like fun. I'll plan to be there. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cloj

Re: assert-args private?

2009-02-06 Thread Chouser
ros go through. Keeping it private means its name and API can be improved without breaking anyone else's code. I suppose if everyone thinks its good enough as-is, we can petition Rich to make it public. --Chouser --~--~-~--~~~---~--~~ You received this message

ANN: clojure.contrib.error-kit

2009-02-06 Thread Chouser
e-definition in some namespace, like this? (kit/defcontinue skip-thing "docstring") Could add 'catch' for Java Exceptions and 'finally' support to with-handler forms. --Chouser --~--~-~--~~~---~--~~ You received this message because you

Re: ANN: clojure.contrib.error-kit

2009-02-08 Thread Chouser
consider changing it. But Clojure already has retries in transactions, where code is actually re-run from the beginning. A "restart" doesn't re-run anything, it just skips forward over a certain number of returns and runs an alternate branch of code. "continue" seemed

Re: ANN: clojure.contrib.error-kit

2009-02-08 Thread Chouser
On Sun, Feb 8, 2009 at 9:24 AM, Meikel Brandmeyer wrote: > Hi, > > Am 08.02.2009 um 14:31 schrieb Chouser: > >> (deferror *foo* [*bar*] "Foo Error" [arg1]) >> (deferror *foo* "Foo Error" [*bar*] [arg1]) ; oops > > A question w/o looking at th

Re: print/println vs. pr/prn

2009-02-08 Thread Chouser
found String where print/println output the value without quotes > and pr/prn include the quotes. What are some other kinds of objects > where the output differs? The only other I see is Character: user=> (prn \tab \x "end") \tab \x "end" nil user=&

unintended consequences of printing

2009-02-09 Thread Chouser
ects. Any mutable Java collection can cause a problem: (let [m1 (java.util.HashMap.) m2 (java.util.HashMap. {:m1 m1})] (.put m1 :m m2) (prn m1)) java.lang.StackOverflowError (NO_SOURCE_FILE:0) That's actually caused by HashMap's .toString method, so it's entirely outside Clojure&#x

Re: A Clojure documentation browser

2009-02-10 Thread Chouser
pens f with reader." [f] (with-open [#^BufferedReader r (reader f)] (let [sb (StringBuilder.)] (loop [c (.read r)] (if (neg? c) (str sb) (do (.append sb (char c)) (recur (.read r nil --Chouser --~--~-~--~--

is mod correct?

2009-02-10 Thread Chouser
lambda x: x % 3, range(-9,9) ) [0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2] --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojur

Re: is mod correct?

2009-02-10 Thread Chouser
div] (if-not (and (integer? num) (integer? div)) (throw (IllegalArgumentException. "mod requires two integers")) (let [m (rem num div)] (if (or (zero? m) (> (* num div) 0)) m (+ m div) --Chouser --~--~-~--~~~---~--~~ You recei

Re: is mod correct?

2009-02-10 Thread Chouser
On Tue, Feb 10, 2009 at 9:37 PM, Timothy Pratley wrote: > > Great! > > (> (* num div) 0) > could be (pos? (* num div)) too I guess... but is sadly slightly > longer! But simpler and clearer. Thanks for the catch. --Chouser --~--~-~--~~~---~

bug + patch: lazy branch take-while is broken

2009-02-12 Thread Chouser
There's a misplaced paren in take-while in the lazy branch. Patch attached. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@g

Re: bug + patch: lazy branch take-while is broken

2009-02-12 Thread Chouser
On Thu, Feb 12, 2009 at 10:20 PM, Chouser wrote: > There's a misplaced paren in take-while in the lazy branch. Patch attached. For what it's worth, using the lazy branch for my clojure-classes project, I had to make two kinds of changes (not counting the patch to core). I ha

Re: How to tell if a variable is bound

2009-02-12 Thread Chouser
7;foo)) will return false. After step 2, (.hasRoot (resolve 'foo)) will return true, and @(resolve 'foo) will return the value, in this case 33. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

eliminating uses of nil punning

2009-02-13 Thread Chouser
ode: (reset! *assert-if-lazy-seq* true) Now anytime you try to use nil punning, you should get an exception. user=> (when (filter neg? [1 2]) :all-pos) java.lang.Exception: LazySeq used in 'if' (NO_SOURCE_FILE:0) user=> (not (concat)) java.lang.

Re: how to emulate lisp's labels functionality?

2009-02-13 Thread Chouser
more like: (defn count-instances [obj lsts] (map #(count (filter #{obj} %)) lsts)) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google

Re: Newbie at macros: Manipulating a vector of bindings

2009-02-13 Thread Chouser
bindvec)] (conc-products [~@(take-nth 2 (rest bindvec))] tokens#)] (conc-fn [...@body] remainder# --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: New mod code is broken

2009-02-13 Thread Chouser
will. Fortunately it already has one: http://code.google.com/p/clojure/issues/detail?id=23#c6 --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: eliminating uses of nil punning

2009-02-13 Thread Chouser
On Fri, Feb 13, 2009 at 1:30 PM, Chouser wrote: > > To turn on the flag you need to rebuild clojure with an > extra option, like this: > > ant -Dclojure.assert-if-lazy-seq=please > > Any non-empty string will do for the value. > > You will need to set the value at runti

Re: Bugs in set and sorted-set (?)

2009-02-14 Thread Chouser
-map can have two keys with the same hash value as long as = returns false. Vectors and lists with the same values evaluate as equal: user=> (= '(1 2) [1 2]) true --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Re: Specifying files with spaces in the name to clojure.contrib.command-line

2009-02-14 Thread Chouser
On Sat, Feb 14, 2009 at 3:56 PM, Kevin Albrecht wrote: > > P.S. Also, unrelated to this problem, the following line in the > example code in command_line.clj is missing the vector surrounding the > bindings of the doseq: > > :else (doseq filename filenames Fixed,

Re: how to emulate lisp's labels functionality?

2009-02-14 Thread Chouser
On Sat, Feb 14, 2009 at 11:32 PM, GS wrote: > > On Feb 14, 12:21 pm, Chouser wrote: >> >> (defn count-instances [obj lsts] >> (let [instances-in (fn thisfn [lst] >>(if (seq lst) >>

Re: rules for writing macros

2009-02-15 Thread Chouser
p str [cls member])) args)) (macroexpand-1 '(call-static Integer parseInt "25")) -> (Integer/parseInt "25") (call-static Integer parseInt "25") -> 25 --Chouser --~--~-~--~~~---~--~~ You received this message because you

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-15 Thread Chouser
have to be made to nil puns for the other seq functions would now have to be made for uses of the new 'rest' function. Sorry if this has been a bit long-winded, but I wanted to explain why I've changed my mind a bit -- changing the meaning of 'rest' may not be as bad as I had

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-15 Thread Chouser
ngs there. This works on the trunk. I just tried this on 1282 lazy branch with assert-if-lazy-seq, and I get no exception and no hang: user=> (time (db-write)) "Elapsed time: 802.020886 msecs" I wonder what's different? I seem to have version 1.6.0

Re: Fully lazy sequences are coming - feedback wanted!

2009-02-15 Thread Chouser
On Sun, Feb 15, 2009 at 5:03 PM, Stephen C. Gilardi wrote: > > Should we branch contrib and do the fixups on a lazy branch? Chouser, have > you already fixed it enough to compile with clojure contrib's build.xml? I don't ever compile clojure-contrib, I just put its src

Re: ANN: clojure.contrib.error-kit

2009-02-15 Thread Chouser
vector (or map) and so should be treated as args vs. a list to be an evaluated expression seems potentially confusing. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: error-kit + test-is

2009-02-15 Thread Chouser
> The assert-expr seems OK, but I can't seem to get the error-type tag from > handle. > > So here's the promised feedback on handle Chouser ;) Thanks! You're a brave man for trying such a thing, when error-kit has such thin documentation. I think there are a couple

Re: error-kit + test-is

2009-02-15 Thread Chouser
If Vars were Named, I think it would work, and it's not at all clear to me why they aren't, since they have a namespace and a name just like symbols and keywords do. Rich is probably too busy with lazier just now, but I intend to be annoying about this at some later date. --Chouser --~

Re: Length of Sequence

2009-02-15 Thread Chouser
this discussion group. [1] http://clojure.org/contributing [2] http://code.google.com/p/clojure/issues --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: Macro defining Macros issue.

2009-02-15 Thread Chouser
user=> `(foo# ~(vector `foo#)) (foo__651__auto__ [foo__650__auto__]) Note the numbers 650 and 651 are indeed different. condp is rather nice though, isn't it? :-) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

Re: error-kit + test-is

2009-02-16 Thread Chouser
s raised.")))) (handle *error* {:as err#} (report :fail ~msg '~form (:tag err#)) hm, I think the second :fail message there may not be right. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: unintended consequences of printing

2009-02-16 Thread Chouser
ou may want to make a more lasting change by doing: (set! *print-level* 10) ; or something like that. Note that this new value of *print-level* is seen only by the thread your REPL is currently running in. --Chouser --~--~-~--~~~---~--~~ You received this message

Re: error-kit + test-is

2009-02-16 Thread Chouser
On Mon, Feb 16, 2009 at 12:13 PM, David Nolen wrote: > > I believe handle does the isa? check on the error type, correct? Right. > If so then this will allow inherited error types to pass the test. Sounds good! --Chouser --~--~-~--~~~---~--~~ You

Re: terminology question re: binding

2009-02-16 Thread Chouser
=> true (.getRoot #'x) ==> 5 I don't know if it's more correct, but it might be less confusing to say "The symbol user/foo is bound to a var which has a root value of 10". --Chouser --~--~-~--~~~---~--~~ You received this message b

Re: terminology question re: binding

2009-02-16 Thread Chouser
On Mon, Feb 16, 2009 at 5:29 PM, Chouser wrote: > > I don't know if it's more correct, but it might be less confusing to > say "The symbol user/foo is bound to a var which has a root value of > 10". Eh, well, I'm not sure about that first part. I don't

Re: Clojure on CLR/DLR

2009-02-16 Thread Chouser
ity of code written to run on your port will not work on Clojure/JVM, because of the runtime libs available (please correct me if I'm wrong), it's important for a body of code to be able to clearly declare where it's supposed to work. A name that is used consistently can help, I would th

Re: Newbie: Separating and grouping the elements in a bunch of vectors

2009-02-16 Thread Chouser
On Mon, Feb 16, 2009 at 7:54 PM, samppi wrote: > > Thanks a lot, everyone. Isn't > (reduce conj [] (apply map vector [[:a :b] [1 2] ['a 'b]])) > equivalent to > (into [] (apply map vector [[:a :b] [1 2] ['

Re: terminology question re: binding

2009-02-17 Thread Chouser
much so because I care about being consistent with the classic meaning of these words in various other languages, but I'm all for careful use of English to reduce confusion as much as possible. --Chouser --~--~-~--~~~---~--~~ You received this message be

Re: Fully lazy sequences are here!

2009-02-17 Thread Chouser
s: the lazy branch is still there, but it's probably best to ignore it now and make all further lazy changes to trunk. If it seems to be working, we can delete the lazy branch later. Thanks Stuart for setting that up and getting a bunch of key changes in. --Chouser --~--~-~--~

Bug: LazySeq.equiv()

2009-02-17 Thread Chouser
Empty lazy seqs do not always compare as equal: user=> (= (map inc nil) ()) false The problem is in IPersistentCollection equiv: user=> (.equiv (map inc nil) ()) false --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Bug: LazySeq.equiv()

2009-02-17 Thread Chouser
On Tue, Feb 17, 2009 at 8:37 PM, Chouser wrote: > Empty lazy seqs do not always compare as equal: > > user=> (= (map inc nil) ()) > false The problem appears to be when the first seq being compared is empty but not identical to the second collection. The attached patch fixes this

Re: clojure.contrib.repl-ln vs. new lazy

2009-02-17 Thread Chouser
sts that genclass.clj could use some lazy love. I think this I have just the lazy love it needs... --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send em

Re: what is the new version of clj about?

2009-02-17 Thread Chouser
On Tue, Feb 17, 2009 at 8:56 PM, Jeffrey Straszheim wrote: > http://clojure.org/lazy Also: http://blog.n01se.net/?p=39 I know, I'm shameless. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Fully lazy sequences are here!

2009-02-17 Thread Chouser
On Tue, Feb 17, 2009 at 3:47 PM, Chouser wrote: > On Tue, Feb 17, 2009 at 2:43 PM, Rich Hickey wrote: >> >> Please do not rush to this version unless you are a library/tool >> developer. Let them do their ports and chime in on their progress. >> Move only when the

Re: terminology question re: binding

2009-02-17 Thread Chouser
user/pung, to be specific) has the root value 8, but was there anything "bound" there? And I can't deny that pung becomes bound to 9 since a macro named 'binding' was used. Does that imply that the var was bound to 8 earlier? Was the name 'pung' bound to the Var? E

Re: bug affecting clojure.core/bean?

2009-02-18 Thread Chouser
a lazy-seq, a destructured 'first' but an unforced 'rest'. This is already the third or fourth time I've wanted to be able to do something like: (fn thisfn [plseq] (lazy-seq (when-let [[pkey &rest etc] plseq] (cons (new clojure.lan

Re: Fully lazy sequences are here!

2009-02-18 Thread Chouser
sequence functions return () instead of nil. Is > 'reverse' correct? Things that return lazy seqs now return an empty lazy seq, which prints as (), instead of nil. However, 'reverse' is not lazy and normally returns a Persistent

Re: Idiomatic Way to Write the Following:

2009-02-18 Thread Chouser
xes)] (loop [i (int 0) sq (seq coll) v []] (if-not sq v (recur (inc i) (next sq) (if (iset i) v (conj v (first sq)))) --Chouser --~--~-~--~~~---~--~~ You received this messa

Re: Contributing

2009-02-18 Thread Chouser
rity checking during compilation: http://code.google.com/p/clojure/issues/detail?id=17 A Lisp reader without access to EvalReader(): http://code.google.com/p/clojure/issues/detail?id=34 --Chouser --~--~-~--~~~---~--~~ You received this message because you are

Re: Bug in clojure.contrib.lazy-xml: apostrophe not escaped correctly

2009-02-18 Thread Chouser
On Wed, Feb 18, 2009 at 6:20 PM, Stephan Mühlstrasser wrote: > > user=> (use 'clojure.contrib.lazy-xml) > nil > user=> (emit { :tag :a, :attrs { :b "bloody apostrophe's :-)" }}) > > > nil Fixed, thanks for the report. --Chouser --~--~

Re: Yet another "how do I make gen-class work?" thread

2009-02-19 Thread Chouser
sider using proxy instead? Note that even Clojure builtins have been built using proxy -- formerly 'atom' and now 'future': http://tinyurl.com/bpjew7 --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

Re: VerifyError overrides final method / forwarding interface calls to multimethods

2009-02-19 Thread Chouser
tDefaultRenderer table Object (proxy [DefaultTableCellRenderer] [] (getTableCellRendererComponent [tbl obj isSelected hasFocus r c] (proxy-super getTableCellRendererComponent tbl obj isSelected hasFocus r c --Chouser --~--~-~--~~~-

Re: Yet another "how do I make gen-class work?" thread

2009-02-19 Thread Chouser
what the best approach is, I just know that much prefer the dynamic nature of proxy and when possible would rather use it. Perhaps what I outlined above is too convoluted for your taste, and I think that would be a reasonable response. I mostly want to make sure proxy is not overlooked. --Chouser

Re: Yet another "how do I make gen-class work?" thread

2009-02-20 Thread Chouser
unction > as a peer of MultiFn, but truthfully, I'm not sure there's really > any reason to want that. Both extend AFn, so I think they're siblings even if one of them has a goofy name. --Chouser --~--~-~--~~~---~--~~ You received this messag

Re: Calling method in Java that mutates passed argument

2009-02-20 Thread Chouser
== [ 0] () [ 1] (Collection) [ 2] (int) [..snip..] So it can take a collection, like a clojure vector: user=> (def lst (java.util.ArrayList. ["1" "KB" "K6" "2" "EÜ" "EZ" "ES"])) #'user/lst And finally, the

Re: expansion of (.method obj)

2009-02-21 Thread Chouser
rCase) It already does, but the repl by default does not print metadata: (binding [*print-meta* true] (prn (macroexpand '(.toUpperCase #^String s)))) ==> (. #^String s toUpperCase) --Chouser --~--~-~--~~~---~--~~ You received this message because you are

Re: where is contrib?

2009-02-21 Thread Chouser
On Sat, Feb 21, 2009 at 12:25 PM, Frantisek Sodomka wrote: > > For example, lazy-cons is still present in: > combinatorics.clj > lazy_xml/with_pull.clj > monads/examples.clj lazy-xml is fixed as of rev 493. Thanks for the re

Re: nth with regex Matchers

2009-02-21 Thread Chouser
def m (re-matcher #"(a)(b)" "ababaa")) #'user/m user=> (re-find m) ["ab" "a" "b"] user=> (class m) java.util.regex.Matcher user=> (nth m 1) "a" I would recommend avoiding using re-matcher or the single-arg re-find unless

Re: Clojure Naming Conventions

2009-02-21 Thread Chouser
some other distinction that needs to be made? Does logically constant mean something different from what I've described above? --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" gro

Re: Clojure Naming Conventions

2009-02-21 Thread Chouser
ents IFn, the other doesn't, but neither changes. This distinction is even more blurred when the value held by the Var is both a collection and fn, like a map or vector. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

Re: Parenscript in clojure?

2009-02-22 Thread Chouser
uot;foo",(function __user_fn_528_foo_530(x_1,y_2){ return (clojure.lang.Numbers.add(x_1,y_2))})))}).apply(null,[]) nil ClojureScript is not yet up to date with the recent lazy-seq changes. --Chouser --~--~-~--~~~---~--~~ You received this message because you are

Re: Parenscript in clojure?

2009-02-22 Thread Chouser
tax for it and, most importantly, macros. Ah, ok. That is indeed quite different from ClojureScript, primaryly because it has immutable collections. And nearly unreadable output. :-) So now my question is -- in what way is ParenScript insu

Re: validators for Refs

2009-02-22 Thread Chouser
t; That's seems to be the case though. Can someone confirm that? The docstrings for the reference types include this phrase: If the new state is unacceptable, the validate-fn should return false or throw an exception. So it seems you are correct abou

Re: Parenscript in clojure?

2009-02-22 Thread Chouser
jure-ish behaviour). The ClojureScript runtime when compacted and compressed should only cost around 22KB. But of course even that is too much if you don't need immutable collections and such. --Chouser --~--~-~--~~~---~--~~ You received this message bec

Re: with-meta and concat

2009-02-22 Thread Chouser
t; Does anyone have any advice on a workaround? LazySeq extends AFn, so you can't change the metadata once the object exists. However, Seq's still accept meta-data, so: (with-meta (seq (concat [1 3] [8 4])) {:tail true}) --Chouser --~--~-~--~~~---~-

:use feature requests

2009-02-23 Thread Chouser
alias the namespace and refer all the symbols could say [my.lib :as mylib :exclude ()] --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: :use feature requests

2009-02-23 Thread Chouser
nitely breaking change, but not > breakage that will be at all difficult to find or fix in old or new code. I'm completely in favor of all of this -- let's do it! --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

Re: retrieving argument :tag metadata

2009-02-24 Thread Chouser
defn form: user=> (binding [*print-meta* true] (prn (:arglists ^#'future-call))) ([#^Callable f]) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this g

Re: Logic Programming Contrib

2009-02-24 Thread Chouser
ds to be the original work of (or owned by, I suppose) someone who has signed the Clojure CA. The MIT license may be sufficient to make a port publicly available, but is not sufficient for something to be an official part of the Clojure project. That's my underst

Re: Why pass bindings as vector

2009-02-24 Thread Chouser
lues in the bindings, but in other cases, the vector is expected to > have exactly two items. This change was made in early November last year. Before that, it was "confusing for people because they don't know if they need a vector or not, f

Re: error-kit and threads

2009-02-25 Thread Chouser
The problem is that though future propagates exceptions on the way out, it does not propagate dynamic binding context on the way in, which is what error-kit needs to do what it does. Also, error-kit uses some thread-local data to pass information up the stack past frames that don

Re: error-kit and threads

2009-02-25 Thread Chouser
On Wed, Feb 25, 2009 at 12:32 PM, Chouser wrote: > On Wed, Feb 25, 2009 at 9:05 AM, Jeffrey Straszheim > wrote: >> Does the stuff in error kit work across thread boundaries.  I'm thinking, >> for instance, if you run a computation using pmap, the individual >> c

Re: Algebraic data types in clojure.contrib

2009-02-25 Thread Chouser
user=> (make-foo "whee") # --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

Re: Is syntax quote "reader" only?

2009-02-26 Thread Chouser
e remaining strictly a reader-time only > mechanism? Use the source, Luke. http://code.google.com/p/clojure/source/browse/trunk/src/jvm/clojure/lang/LispReader.java?r=1287#656 It looks like the reader reads the whole syntax-quoted form, and then walks it recursively looking for unquote forms.

Re: Clojure documentation problems

2009-02-26 Thread Chouser
t the latest svn version. --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 grou

Re: Syntax-quote only as a reader macro?

2009-02-26 Thread Chouser
I'd recommend avoiding using the name of builtins like 'var' for your own locals. --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send emai

Re: read file into byte[]

2009-02-26 Thread Chouser
m (java.io.FileInputStream. "/tmp/datafile")] (let [ch (.getChannel strm) buf (.map ch java.nio.channels.FileChannel$MapMode/READ_ONLY 0 (.size ch)) ary (make-array Byte/TYPE (.size ch))] (.get buf ary) ary)) Seriously, what

Re: Please take mercy on us newbies

2009-02-27 Thread Chouser
lish text describing what's going on. Another good place to look is in clojure-contrib. Code submitted there goes through a minimal vetting process and is actively maintained by people who take the time to stay current on Clojure's growing feature set. Hope that helps, --Chouser --~--

Re: letfn - mutually recursive local functions

2009-02-28 Thread Chouser
oline, though: (letfn [(a [n] #(if (zero? n) n (b (dec n (b [n] #(if (zero? n) n (c (dec n (c [n] #(if (zero? n) n (a (dec n] (trampoline c 10)) --Chouser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

Re: Utility / Reflection functions

2009-03-02 Thread Chouser
code for Clojure defn's, etc. all from the REPL. I also saw functionality in your posted code that's similar to other functions found in clojure-contrib. You may want to poke around and see if any of it looks useful to you: http://code.google.com/p/clojure-contri

<    1   2   3   4   5   6   7   8   >