On Sun, Jan 16, 2011 at 2:50 AM, Benny Tsai benny.t...@gmail.com wrote:
In the Hacker News discussion about that talk, someone posted a link
to another talk by Guy Steele on the same topic:
http://vimeo.com/6624203
... where he covers the material in somewhat greater depth (the
downside
Hi,
I came across this issue while implementing a lazy, efficient flatten that
also uses the whole sequence abstraction (flatten java arrays).
The problem with (seq x) is, that it will throw an Exception if called on
something, that cannot be coerced to sequence, so I just used sequencial?
On Sun, Jan 16, 2011 at 6:22 AM, Jürgen Hötzel juer...@hoetzel.info wrote:
Hi,
I came across this issue while implementing a lazy, efficient flatten that
also uses the whole sequence abstraction (flatten java arrays).
The problem with (seq x) is, that it will throw an Exception if called
On 16 January 2011 05:35, Jason Wolfe ja...@w01fe.com wrote:
(a) unsafe/incorrect value on overflow/fastest/unifiable* vs.
(b) safe/error on overflow/fast/unifiable vs.
(c) safe/promoting on overflow/slow/not-unifiable
If I understand correctly, the issue with auto-promotion is that we
have
Hi,
I think there're two typos in
http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/add-watch
- I believe 'if' should become 'of':
The watch fn will be called synchronously, on the agent's thread if an
agent, before any pending sends if agent or ref.
should become
The watch
I've been trying to understand exactly how these two statements are
evaluated by tracing execution through Compiler.java, Reflector.java,
etc of tag 1.2.0.
The second form - (.foo bar), expanded to (. bar foo) - eventually
calls Reflector.invokeNoArgInstanceMember.
The first form - (.foo (new
The 'if' is terse, but correct: call is on agent's thread only when reference
is an agent, and before pending sends only when reference is an agent or ref.
Cheers,
Stu
Hi,
I think there're two typos in
http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/add-watch
- I
movies.core (list? (apply list (map identity [1 2 3])))
true
Makes sense to me!
movies.core (list? (list* (map identity [1 2 3])))
false
Huh?
-
Brian Marick, Artisanal Labrador
Contract programming in Ruby and Clojure
Author of /Ring/ (forthcoming; sample:
2011/1/16 Robert Campbell rrc...@gmail.com:
The second form - (.foo bar), expanded to (. bar foo) - eventually
calls Reflector.invokeNoArgInstanceMember.
For that form, the clojure compiler cannot infer the type of bar, and
does not know which exact method (class + type signature) .foo
list* consumes its last argument lazily, which means it can't count it
(a requirement to be a real list). Both functions return objects that
are seqs, though, so you can (seq?) them if you want.
user= (def x (list* (range)))
#'user/x
user= (def x (apply list (range)))
java.lang.OutOfMemoryError:
Steele is advocating binaries trees as an way of
doing parallel computation. I think that this idea
is reasonable but might be more effectively applied
in Clojure.
The idea of binary could be expanded in a very
simple way to use log32 instead which is a natural
mapping to the Clojure data
the documentation on that could be improved. the doc string for that
is basically the same as for list. but they return different types.
rather surprising when you first see it.
On Sun, Jan 16, 2011 at 1:55 PM, Alan a...@malloys.org wrote:
list* consumes its last argument lazily, which means
On 01/12/2011 11:50 PM, Robert McIntyre wrote:
They seem to allow you to include anything in a lib directory that you'd want.
I sometimes include apache commons-io and clojure-contrib1.2 without
any problems.
I also included a sql connection library for one of the problems, so
it seems fine :)
Hi Randy,
You can access a seq of the command line args via the *command-line-
args* var.
On Jan 16, 3:03 pm, Randy J. Ray randy.j@gmail.com wrote:
On 01/12/2011 11:50 PM, Robert McIntyre wrote:
They seem to allow you to include anything in a lib directory that you'd
want.
I
Then again, how often do you write code that might be
doing maths with numbers that big and not realise it? For that
matter, how often do you write code that might be doing maths with
numbers that big and not spend time thinking carefully about its
performance anyway?
This reminds me of a
(a) unsafe/incorrect value on overflow/fastest/unifiable* vs.
(b) safe/error on overflow/fast/unifiable vs.
(c) safe/promoting on overflow/slow/not-unifiable
If I understand correctly, the issue with auto-promotion is that we
have to box the output of an operation even if it turns out
On Sun, Jan 16, 2011 at 3:50 PM, Jason Wolfe ja...@w01fe.com wrote:
Moreover, we do not need to redefine the class at run-time. A simple
way to do this: when you compile a function with arithmetic
operations, concatenate bytecode for two versions: essentially, one
with the unprimed
Benny already answered, but here's the common block that I'm using for
my Clojure submissions:
(import '(java.io BufferedReader FileReader))
(defn process-file [file-name]
(let [rdr (BufferedReader. (FileReader. file-name))]
(line-seq rdr)))
(defn my-func [col]
; Do something interesting
Is it insane to suggest that perhaps clojure should work with scala
such that we can write both languages in the same file?
Use scala to do you strongly typed work and things where you are
really concerned that auto-promotion. Let the language made for
helping a programmer lots of information
Hi,
Have you used Enlive[1]? It's a nice tool for HTML scraping and templating -
it might be more robust than your regexp-based solution. It takes a bit of
learning, though.
Regards,
Stuart
[1] https://github.com/cgrand/enlive
On 16 January 2011 05:57, justinhj justi...@gmail.com wrote:
After reading Oleg's lecture Typed tagless-final interpretations
( http://okmij.org/ftp/tagless-final/course/ ), I decided to see if
this was possible, or made any sense, to follow this style in
Clojure.
The idea is that, instead of representing a DSL syntax as a data
structure that you
There was some discussion about this topic after David Liebke's talk
at the conj about the prototype fork/join filter/map/etc work that
Rich did. The talk isn't out on video yet but slides are here:
http://incanter.org/downloads/fjclj.pdf
and I wrote up some of these notes here:
Excellent. I am taking notes on Steele's talk and adding them
to the CiSP parallel section. In Clojure it might be possible
to dynamically change the number of processes. With the
bit-partition idea is might even be convenient.
There was some discussion about this topic after David Liebke's
Hi all,
I am trying to implement the function 'group-by' from Clojure.Core
using my current knowledge of Clojure but cannot get pass a
java.lang.Exception.
This is the code so far:
(defn key? [key coll]
(some #{key} (keys coll)))
(defn my-group-by [f coll]
(let [test (fn [m x]
Hi,
The exceptions stems from the call to vec. vec turns a collections
(read: seqable thing) into a vector. The right function calls is
vector.
(defn my-group-by
[f coll]
(let [test (fn [m x]
(let [res (f x)]
(if (key? res m)
(conj (m res)
On Mon, Jan 17, 2011 at 1:47 AM, Stefan Rohlfing
stefan.rohlf...@gmail.com wrote:
Hi all,
I am trying to implement the function 'group-by' from Clojure.Core
using my current knowledge of Clojure but cannot get pass a
java.lang.Exception.
This is the code so far:
(defn key? [key coll]
26 matches
Mail list logo