Re: Vector is only half associative?

2013-06-20 Thread Stephen Compall
-with + [1 2 3] [4 5 6 7]) (merge-with + {6 7, 8 9} [1 2 3]) (merge-with + [1 2 3] {}) -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: The order of lazy-seq

2013-05-01 Thread Stephen Compall
using lazy-seq As you have seen, lazy-seq is not a silver bullet. -- Stephen Compall If anyone in the MSA is online, you should watch this flythrough. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Working with a huge graph - how can I make Clojure performant?

2013-03-27 Thread Stephen Compall
if you do ^^^ *after* vvv? (explored v) (recur vs explored lhalf rhalf (inc iter-cnt)) -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: defrecord and map

2013-03-24 Thread Stephen Compall
)) -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- -- 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

Re: let-timed macro...any suggestions/corrections?

2013-03-23 Thread Stephen Compall
. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- -- 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

Re: Optimized code = now it's 4x slower. Why?

2013-03-01 Thread Stephen Compall
/blob/2.0.0/sample.project.clj#L152 -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- -- 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

Re: Clojure Performance For Expensive Algorithms

2013-02-20 Thread Stephen Compall
significantly. (do (assoc! curr (inc j) 0) (recur (inc j) max-len))) Nor is it safe to discard the result of calling assoc!; see how assoc! is used in other online examples. -- Stephen Compall If anyone in the MSA is online, you

Re: Looping and accumulation

2013-02-14 Thread Stephen Compall
it. Consider that several library functions, like map, filter, iterate, and take-while are all lazy-friendly. -- Stephen Compall If anyone in the MSA is online, you should watch this flythrough. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Why is there not much conversation on Spreadsheet like APIs in this group?

2013-02-03 Thread Stephen Compall
, I found more use for Jeff Straszheim's graph contrib library, now packaged with datalog, than the cells-ish stuff. This is probably because my Clojure style seeks immutable solutions, and cells-ishs don't fit in that category. -- Stephen Compall If anyone in the MSA is online, you should watch

Re: Why is there not much conversation on Spreadsheet like APIs in this group?

2013-02-03 Thread Stephen Compall
) that need updates. Yes. Aside from the mutability issue, I also had other problems to which graphs were well-suited, but cells-ishs were not. For example, given the metadata to build a graph, optimum conversion function generalizes to shortest path. -- Stephen Compall If anyone in the MSA is online

Re: Is there a better way to update a map atom?

2013-01-21 Thread Stephen Compall
. -- Stephen Compall If anyone in the MSA is online, you should watch this flythrough. -- 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

Re: Associative extends Seqable?

2013-01-19 Thread Stephen Compall
the ability to override particular mappings. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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

Re: Associative extends Seqable?

2013-01-19 Thread Stephen Compall
of interfaces. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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: Associative extends Seqable?

2013-01-18 Thread Stephen Compall
. So I think inheriting Seqable is a positive statement of this law: anAssociative.entryAt(k) returning entry E, implies that (seq anAssociative) contains E. But I cannot be sure. Without this law, though, you are basically left with (pure) function. -- Stephen Compall If anyone in the MSA

Re: Associative extends Seqable?

2013-01-18 Thread Stephen Compall
the contents. The only way you can apply both transformations is if your domain is vacuous: that is, constant functions like yours are the only ones that permit domain transform in either direction. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received

Re: Better ways of documenting functions with type information?

2013-01-15 Thread Stephen Compall
is a version of that annotation that doesn't require Typed Clojure, or anything at all really, although you don't get the type checking: '(ann my-function [BufferedImage Number Number] - (Option (Seqable ...))) [1] https://github.com/frenchy64/typed-clojure/wiki -- Stephen Compall

Re: Extracting map values matching a pattern

2013-01-06 Thread Stephen Compall
, and you do not need to process them in numeric order, your suggested approach is fine. -- Stephen Compall If anyone in the MSA is online, you should watch this flythrough. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: Unable to save the source file which loads repl

2013-01-06 Thread Stephen Compall
something else, maybe wrap the repl call in (future ...), maybe put your actual app in a separate file. -- Stephen Compall If anyone in the MSA is online, you should watch this flythrough. -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Issues with record and atom

2013-01-05 Thread Stephen Compall
, included with the standard distribution, to avoid mutable constructs and still be able to walk up and down your tree. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Are strings expensive for memory on the JVM?

2013-01-04 Thread Stephen Compall
On Jan 4, 2013 6:06 PM, larry google groups lawrencecloj...@gmail.com wrote: (swap! recent-activity concat feed @recent-activity) This swap! replaces the value in recent-activity with (concat @recent-activity feed @recent-activity), approximately. -- Stephen Compall If anyone

Re: Different concrete type reported from macro

2013-01-03 Thread Stephen Compall
here: http://thread.gmane.org/gmane.comp.java.clojure.user/66294 ; search for further threads on the seq* trichotomy. tl;dr don't use 'list?'. -- Stephen Compall If anyone in the MSA is online, you should watch this flythrough. -- You received this message because you are subscribed to the Google

Re: Will the JVM will always likely, remain the primary Clojure implementation ?

2012-12-28 Thread Stephen Compall
On Dec 27, 2012 11:55 PM, Sukh Singh suckhsi...@gmail.com wrote: Is there any chance of clojure community abandoning the JVM as the primary plaform in the future? Yes. Who knows what machines lurk in the hearts of programmers? -- Stephen Compall If anyone in the MSA is online, you should

Re: list* not returning a list

2012-12-26 Thread Stephen Compall
of eliminating list?, really, in favor of seq?/sequential?/seqable?. I think that this can be pretty confusing... Shouldn't it be fixed (at least the docstring)? http://dev.clojure.org/jira/ -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message

ANN: stream-stream 0.2.0

2012-12-12 Thread Stephen Compall
-sequence implements all of CharSequence. While this release doesn't have types, typed-clojure gave me the impetus to clean this up and finish the outstanding TODOs, so special thanks to Ambrose Bonnaire-Sergeant for providing that. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition

Re: ANN: stream-stream 0.2.0

2012-12-12 Thread Stephen Compall
it easier to generate sha1's for example? Is it useful for sound/video-like streams? In both cases, I imagine so. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- You received this message because you are subscribed to the Google Groups Clojure group

Re: ANN: stream-stream 0.2.0

2012-12-12 Thread Stephen Compall
', which, for line-buffered streams like stdin, would provide the functionality you want. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: [ANN]First toy-project : CYASUS

2012-12-06 Thread Stephen Compall
that produced it, c. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- 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: A bearded person, Clojure and JavaFX

2012-12-05 Thread Stephen Compall
wrong, though, I encourage you to explore it further. -- Stephen Compall If anyone in the MSA is online, you should watch this flythrough. -- 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

Re: An improvement to PersistentVector

2012-12-04 Thread Stephen Compall
patches. Shall I send it someone, put it somewhere? If you are willing, follow instructions on http://clojure.org/contributing. -- Stephen Compall If anyone in the MSA is online, you should watch this flythrough. -- You received this message because you are subscribed to the Google Groups Clojure

Re: Macro not being expanded?

2012-11-27 Thread Stephen Compall
? to find the predicate you want. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- 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

Re: Nested/inner classes with gen-class

2012-11-20 Thread Stephen Compall
-class :name foo.bar$Baz) and you'll be fine. This works for me on Clojure 1.4. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: Java-to-Clojure source translation?

2012-11-04 Thread Stephen Compall
of this thread is that, from the perspective of varying levels of Clojure expertise, such means would be more of a hindrance than a help in your goal. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- You received this message because you are subscribed

Re: impossible to create classes for non-closure environment

2012-11-03 Thread Stephen Compall
])) names))) ;; makes classes foo, bar, baz, qux, quux, all with the :x field. (defrefs foo bar baz qux quux) -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: monads

2012-10-27 Thread Stephen Compall
in prose referring to values, not type variables. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- 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

Re: monads

2012-10-26 Thread Stephen Compall
monads. We can always write things out explicitly instead of exploiting existing abstractions. As for macros, the above samples use ordinary Haskell function calls. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- You received this message because you

Re: what is the simplest user auth system possible?

2012-10-25 Thread Stephen Compall
kept in MySql). I am curious what is the absolutely easiest way to do this? The easiest auth system to write is the one that's already written. https://github.com/cemerick/friend -- Stephen Compall If anyone in the MSA is online, you should watch this flythrough. -- You received this message

Re: clojure.java.jdbc create-table

2012-10-08 Thread Stephen Compall
it be? It's difficult to tell without usable, minimized examples of succeeding and failing code. This exercise may even tell you what is wrong. -- Stephen Compall If anyone in the MSA is online, you should watch this flythrough. -- You received this message because you are subscribed to the Google

Re: CLR Reflection Laziness

2012-09-28 Thread Stephen Compall
— is likely to be ill-served by a REPL exit. A counterexample demonstrates this: Squeak drops into a debugger on normal execution failure, as historical Smalltalk philosophy is that all computer users should learn programming. -- Stephen Compall Greetings from sunny Appleton! -- You received

Re: algo.monad state-m fetch-val bug and efficiency issue

2012-09-08 Thread Stephen Compall
the abstractions. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- 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

Re: algo.monad state-m fetch-val bug and efficiency issue

2012-09-08 Thread Stephen Compall
, or a behavioral one? I would say the former; we are, after all, in a context in which functions have primacy over maps. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- You received this message because you are subscribed to the Google Groups Clojure group

Re: using take-while with pred function that has state

2012-09-04 Thread Stephen Compall
invariant was added in Rich Hickey's a8307cc8, back in 2008. [2] Describing such examples would be rather esoteric for this thread, I feel. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- You received this message because you are subscribed to the Google

Re: An instance of an abstract class in the repl?

2012-09-04 Thread Stephen Compall
. The trick here is that by putting your reify/deftype/proxy *once*, AOTing that, you'll reuse the same Scala function class for every Clojure function. That depends, of course, on the Clojure functions *not* dropping into this nonsense. -- Stephen Compall ^aCollection allSatisfy: [:each

Re: using take-while with pred function that has state

2012-09-04 Thread Stephen Compall
On Tue, 2012-09-04 at 15:24 -0700, Sean Corfield wrote: But that is a hypothetical, yes? You're not suggesting that take-while actually does that, right? Right. As of right now. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- You received

Re: redefining multimethods at the repl

2012-09-04 Thread Stephen Compall
On Tue, 2012-09-04 at 17:31 -0500, Brian Marick wrote: user= (defmulti collide classify-colliding-things) If you're okay with a little handwaving, how about (defmulti collide #'classify-colliding-things) Now there is no need to rerun defmulti. -- Stephen Compall ^aCollection allSatisfy

Re: using take-while with pred function that has state

2012-09-03 Thread Stephen Compall
recommend reading the implementations of map, filter, and concat in core.clj to gain a better understanding of seq chunking. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: using take-while with pred function that has state

2012-09-03 Thread Stephen Compall
On Mon, 2012-09-03 at 01:12 -0700, Alan Malloy wrote: (map #(do %2 %1) c1 c2) is a neat trick I hadn't seen in this context; thanks for showing me! Perhaps you'd also like to advocate for the inclusion of `first-arg', which has several other uses, in core? :) -- Stephen Compall ^aCollection

Re: Possible to merge destructuring :or defaults with :as?

2012-09-02 Thread Stephen Compall
:or is that they're visible to callers via :arglists. This'd help make the process more convenient in the (relatively common) case where you'd like to preserve arbitrary args, but apply some defaults in a transparent way. When you want this, (let [{blah} (merge my-defaults kwargs)] -- Stephen Compall

Re: using take-while with pred function that has state

2012-09-02 Thread Stephen Compall
#(...)), (map #(do %2 %1) ss), last) Use of `atom' for this sort of thing is certainly an antipattern, so consider any alternative that suits you. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- You received this message because you are subscribed

Re: Problems importing java classes

2012-09-02 Thread Stephen Compall
. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- 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

Re: Lazily extract lines from large file

2012-08-22 Thread Stephen Compall
needless lets is a matter of style in this case. -- Stephen Compall If anyone in the MSA is online, you should watch this flythrough. -- 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

Re: newbie question on namespaces and reference resources

2012-08-17 Thread Stephen Compall
universal, though. 2. Is there a reference somewhere out there where I could consult these kinds of questions? The best reference is existing project practice; there's a wealth of free software source code out there. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better

Re: Why is map not being lazy here?

2012-07-01 Thread Stephen Compall
Laziness and nondeterminism make an explosive mixture. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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

Re: Need advice about XML parsing and exposing attributes to Java

2012-06-29 Thread Stephen Compall
with all of the getters. Maybe you could derive that list from an XML file of some kind. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email

Re: Using read-string and macros together

2012-06-14 Thread Stephen Compall
bots use. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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: IllegalStateException I/O in transaction in REPL

2012-06-14 Thread Stephen Compall
On Thu, 2012-06-14 at 13:33 -0700, dmirylenka wrote: Could you please explain a bit more? I don't have any dosync in my code. Look through your backtrace for a call to clojure.lang.LockingTransaction.runInTransaction. Its caller is using dosync. -- Stephen Compall ^aCollection allSatisfy

Re: why String is not a collection (of Character)

2012-06-08 Thread Stephen Compall
On Jun 8, 2012 3:18 AM, Cédric Pineau cedric.pin...@gmail.com wrote: (defn seqable? More modernly, this function can be found in core.incubator. -- Stephen Compall Greetings from sunny Appleton! -- You received this message because you are subscribed to the Google Groups Clojure group

Re: hyphenate - imperative for

2012-06-06 Thread Stephen Compall
achieve greater simplicity, because they are strictly less powerful than their persistent counterparts. I suggest trying to find the simplest implementation, and worrying about efficiency once you have that. -- Stephen Compall Greetings from sunny Appleton! -- You received this message because you

Re: lazy-cat infinite realization on empty seq

2012-06-03 Thread Stephen Compall
condition. -- Stephen Compall Greetings from sunny Appleton! -- 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

Re: maths, functions and solvers

2012-05-24 Thread Stephen Compall
in mind. The real trouble is discriminating between bound and free vars. -- Stephen Compall Greetings from sunny Appleton! -- 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

Re: code as data vs. code injection vulnerability

2012-05-09 Thread Stephen Compall
when you need it. -- Stephen Compall Greetings from sunny Appleton! -- 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

Re: Update an item from a list of maps in STM transaction

2012-04-02 Thread Stephen Compall
that. I tried using one FUTURE for a REF but is not working. Not sure what this means. Futures are IDerefs... -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: What's the efficient functional way to computing the average of a sequence of numbers?

2012-03-30 Thread Stephen Compall
uncounted sequences, the cost of a second traversal for count may be less than the bookkeeping cost of keeping a count as you traverse once. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups

Re: into applied to transient vectors undocumented?

2012-03-22 Thread Stephen Compall
and conj don't work on transients. Idempotence [interpreted as identity over transients] would be even worse; it would mean that 'into' is not a pure function. reduce conj! is a decent replacement. -- Stephen Compall Greetings from sunny Appleton! -- You received this message because you

Re: Returning Success

2012-03-20 Thread Stephen Compall
returns the extra results in a tuple with the primary return value. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Need opinions on arglists with optional arguments

2012-03-11 Thread Stephen Compall
for humans, who can tell whether a boolean or optional arg is probably meant from context, and not autocompleters. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Next vs. rest (and reduce)

2012-02-25 Thread Stephen Compall
' when you are definitely about to force it with `seq', `empty?', or something anyway, `rest' otherwise. `reduce' qualifies for the former. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups

Re: Help! Migrating to 1.3.0

2012-01-13 Thread Stephen Compall
/design/Where+Did+Clojure.Contrib+Go . In the selected example, duck-streams was replaced with the included clojure.java.io in Clojure 1.2. -- Stephen Compall ^aCollection allSatisfy: [:each | aCondition]: less is better than -- You received this message because you are subscribed to the Google

Re: clojure.data diff question

2012-01-13 Thread Stephen Compall
because you can't skip 0 to get to 1, etc.) -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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

Re: AoT Compilation fails

2012-01-08 Thread Stephen Compall
works in some context, because that SLIME function is implemented as a regular load on swank-clojure's side. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: Prefix tree creation in clojure

2012-01-02 Thread Stephen Compall
if coll has no items - same as (not (seq coll)). Please use the idiom (seq x) rather than (not (empty? x)) ...and several past discussions on this list not otherwise relevant to this thread. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received

Re: Do you use Monads in your real clojure applications

2012-01-02 Thread Stephen Compall
think, be a good use case for the reader monad when it's ready. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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: clj-http - how to use cookies in subsequent request

2012-01-01 Thread Stephen Compall
httpcomponents-client can hold on to a stateful cookie jar for multiple requests. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Prefix tree creation in clojure

2012-01-01 Thread Stephen Compall
: (Node. (conj (.strings node) string) edges))) It remains to be seen, but it seems likely to me that the new (1.3) `map-Node' and `-Node' will become idiomatic here. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you

Re: Prefix tree creation in clojure

2012-01-01 Thread Stephen Compall
page about the numerics changes, but that's obviously not the full extent of 1.3's changes. http://dev.clojure.org/display/design/defrecord+improvements The mostly complete master list is changes.txt or changes.md in the source. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition

Re: defrecord based on runtime metadata?

2011-12-18 Thread Stephen Compall
evaluated when loading the compiled files later. In short, my-stuff should have deterministic, repeatable results, and should therefore only rely on deterministic features of (hey you!), e.g. gensyms will break. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You

Re: Error converting an example written in C++, TCL, python to clojure

2011-12-18 Thread Stephen Compall
, so you won't be able to refer to either of them without more stuff around this. Same with `volume'. (- (.GetActiveCamera) (.SetFocalPoint (.GetCenter volume 0 1 2))) And why so many args to GetCenter? -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better

Re: lazy-seq and recursion.

2011-12-17 Thread Stephen Compall
-seq (prn and this lazy seq has no first element to speak of) nil) -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: multiple return values

2011-12-13 Thread Stephen Compall
. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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

Re: Opposite function to cons, but in terms of construction, not destruction.

2011-12-13 Thread Stephen Compall
'( 1 2 3) 4) 6) 7) Though you should note that, despite the `lazy-seq' wrapper around the body, as soon as you force the outermost seq, you're forcing all the way down. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you

Re: Opposite function to cons, but in terms of construction, not destruction.

2011-12-13 Thread Stephen Compall
. more). It is the same problem with repeatedly concatting to the end, and with left-fold in a top-down evaluation scheme like Haskell: you can run out of stack if you must travel deep to get to the first element. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better

Re: Lazy-seq of a binary file

2011-12-12 Thread Stephen Compall
. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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

Re: multiple return values

2011-12-12 Thread Stephen Compall
...] (.put asides retval extra-data) retval)) (let [x (function-with-two-return-values ...)] (prn x) (prn (.get asides x))) -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups

Re: Lazy-seq of a binary file

2011-12-12 Thread Stephen Compall
On Mon, 2011-12-12 at 20:03 -0800, Simone Mosciatti wrote: Any suggest of how fix that ? In general, avoid loop. Specifically, try using letfn or (fn SOME-NAME-HERE [args...] ...) as your recursion target. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You

Re: Lazy-seq of a binary file

2011-12-11 Thread Stephen Compall
. As for the reading part itself, I suggest careful usage of `iterate' and `take-while' (or `lazy-seq' and `cons') from the standard library, with appropriate .read calls. Byte-by-byte reading can be accomplished by writing a single iterate, a single take-while, and a single .read call. -- Stephen

Re: let-else macro

2011-12-07 Thread Stephen Compall
the top of the to macro or not to macro? checklist. And may be anyway further generalized: (defmacro - [ forms] `(- ~@(reverse forms))) (- (let [x (foo) y (bar)]) (when y) (let [ ]) (do )) -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better

Re: Building Clojure applications w/ Maven

2011-12-07 Thread Stephen Compall
On Wed, 2011-12-07 at 13:41 +0200, Matteo Moci wrote: lein pom maybe setting up a fake simple lein project you can watch how the generated pom is different from yours. Unfortunately, that pom is too fake to be useful as a comparison tool. -- Stephen Compall ^aCollection allSatisfy: [:each

Re: on lisp and scheme macros

2011-12-06 Thread Stephen Compall
itself can be defined as a simple syntax-case macro. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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

Re: Ending or closing malformed line in REPL

2011-12-05 Thread Stephen Compall
On Mon, 2011-12-05 at 09:51 -0800, jlhouchin wrote: When I entered the closing and then closing paren. I was fine. You may also try backspace; unusually for a REPL, that works. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message

Re: How would you model this data?

2011-12-03 Thread Stephen Compall
(as your nested-maps example does), or add another map. One or the other is faster depending on how many values you have. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups Clojure group

Re: Why no anonymous record types, or (defstruct, create-struct) vs (defrecord, ???)

2011-11-19 Thread Stephen Compall
can't remember the details, but each eval might make a class, too, depending on its complexity. Offset the savings you get with unboxed representations by these costs when evaluating records as your solution. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You

Re: Leiningen local dependencies?

2011-11-19 Thread Stephen Compall
for a Leiningen project. It's best to get Leiningen to compile your Java sources for you. The :java-source-path and :javac-options project.clj settings will help here. If that is not feasible, try including the root of the class files in the :extra-classpath-dirs project.clj option. -- Stephen Compall

Re: Creating a var, functions from a macro

2011-11-19 Thread Stephen Compall
On Wed, 2011-11-09 at 13:50 -0800, Sean Bowman wrote: Apparently the missing bit is I need to escape the symbol calls, e.g. (defn ~(symbol index) ... Is this correct? Better yet, ~'index. There's a good example of this pattern in defmacro fn in clojure/core.clj. -- Stephen Compall

Re: repl dodges ns :use :only ?

2011-11-19 Thread Stephen Compall
; it implies the creation of another namespace (besides the one you are creating!) containing only bar, and aliasing that. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: A question on deftest- macro.

2011-11-07 Thread Stephen Compall
} -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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

Re: Which autodoc dep for clojure 1.3 (and advice on how to solve such questions generally)

2011-11-07 Thread Stephen Compall
are careful. Liberal application of :exclusions [org.clojure/clojure] is advised. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure

Re: Any reason why slingshot hasn't been updated to support 1.3

2011-10-30 Thread Stephen Compall
sense is 1.3 support held off? -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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

Re: updating some values in map

2011-10-22 Thread Stephen Compall
(map (juxt identity (comp f m)) ks))) Perhaps not what you were looking for, but hope this helps anyway. More broadly, you might also want to think about what it means if one of ks isn't in m. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received

Re: Clojure jar files.

2011-10-21 Thread Stephen Compall
of Leiningen. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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: when quotes and when syntax-quotes?

2011-10-17 Thread Stephen Compall
), literally.) -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- 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: Basic Question on Record construction

2011-10-13 Thread Stephen Compall
]) Is there something equivalent to: (def r (apply R. [a b c])) available? (without writing macros?) The above generates -r in 1.3. Check the link above for more. -- Stephen Compall ^aCollection allSatisfy: [:each|aCondition]: less is better -- You received this message because you

  1   2   >