t sounds like you've ignored the thrust of my concern rather than
settling it.
> sexp's only have a list notation because that's all lisp had, and even
> then, some people got it all for free.
That tail did not wag that dog.
--
Steven E. Harris
--
You received this messag
cumentation/HyperSpec/Body/26_glo_p.htm#potential_number
² http://www.lispworks.com/documentation/HyperSpec/Body/02_caa.htm
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegrou
list and a vector, again without a clear basis for his
decision.
As an appeal to prior art, Rivest's "S-Expressions" Internet-Draft¹ used
only a single list structure, though it does define three different
encodings for that structure.
Footnotes:
¹ http://people.csail.mit.edu/rivest/
a/2214049/31818
Note that I wrote it about a year and a half ago. I hope the references
to the Java classes are still correct.
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@g
#x27;³, the former lacks the optional count argument
accepted by the latter.
Footnotes:
¹ http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/take-last
² http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/subvec
³ http://www.lispworks.com/documentation/HyperSpec/B
a distinct class for each.
--
Steven E. Harris
--
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
first
r/src/main/clojure/clojure_hadoop/job.clj
³
https://github.com/stuartsierra/clojure-hadoop/blob/master/src/main/clojure/clojure_hadoop/gen.clj#L5
º
https://github.com/stuartsierra/clojure-hadoop/blob/master/src/main/clojure/clojure_hadoop/job.clj#L31
--
Steven E. Harris
--
You received this messa
to
a change in the `doc' function (and `print-doc').
It's weird that a continuation line starting at column zero doesn't
print as being left-aligned with the first line.
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clo
yielding n + 2) with four or more arguments. What's responsible for
this difference in behavior?
--
Steven E. Harris
--
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 f
ed your function, say, "fmap-values" I would not have
complained.
--
Steven E. Harris
--
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 mode
Daniel Werner writes:
> (some identity maps), on the other hand, checks whether there is any
> non-empty map *in the coll of maps*.
By "non-empty" here, do you really mean non-nil? I don't see how the
identity function would tell you whether any of the maps are empty
mware.com/manuals/?manual=compleat&page=math.html#ldexp
³
http://www.lispworks.com/documentation/HyperSpec/Body/f_dec_fl.htm#decode-float
http://www.lispworks.com/documentation/HyperSpec/Body/f_dec_fl.htm#scale-float
--
Steven E. Harris
--
You received this message because you are subscr
ataggart writes:
> It's fairly common to let over a function, e.g.:
So common, in fact, that Doug Hoyte wrote a book about it:
Let Over Lambda
http://www.letoverlambda.com/
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "C
ng the single-integer constructor,
ensuring that no reallocation and copying occurs. Some temporary
allocation would still be necessary to hold the Object-to-String
projection, as `str' calls Object#toString() on each argument, rather
than assuming the arguments are already of type String.
--
b))
`
[...]
> The reader silently converts 'pung to (quote pung) prior to
> evaluation, so you have to come at it in a roundabout way:
That's not conspiring; that's read-time macroexpansion working as
intended.
--
Steven E. Harris
--
You received this message because you
e vector literal reader with was the
`list' function:
,
| user> (list (+ 1 2) (+ 3 4))
| (3 7)
| user> (vector (+ 1 2) (+ 3 4))
| [3 7]
`
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, se
erSpec/Body/v_pl_plp.htm
--
Steven E. Harris
--
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
David Nolen writes:
> Clojure functions categorized: http://clojuredocs.org/quickref/Clojure%20Core
Wow, that is very nice -- especially the expandable view of the
implementation source.
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Gro
`defgeneric'
or `defmethod' -- if the function name is already bound to a normal
function, macro, or special operator.
Is there supposed to be a difference between the normal function
`pretty-print' I wrote above and the function defined in the
`extend-type' form quoted above?
-
he LRU ordering.
Footnotes:
¹
http://www.dinkumware.com/manuals/default.aspx?manual=compleat&page=stack.html#stack
²
http://www.dinkumware.com/manuals/default.aspx?manual=compleat&page=queue.html#queue
³
http://www.dinkumware.com/manuals/default.aspx?manual=compleat&page=vector.html#vector
ction, I think
you're better of making no claim about what "get" does beyond its normal
contract: promise only that it returns the value mapped to the given
key, if any. This data structure doesn't seem like a good fit for a
functional-style interface.
--
Steven E. Harris
--
Yo
is defined) and the most
recent paredit.el library available for download.
> Or you saw a deficiency in counterclockwise ?
No, I wasn't complaining about Counterclockwise. Rather, I was noting
that the /complete/ behavior of `move-past-close-and-reindent' is hard
to mimic.
--
with symmetric
brackets (for Clojure's '[' and ']') is disappointing, and I have found
the paredit package to be not much better on that front (having
difficulty with balancing '{' and '}'). It has its own set of oddities.
--
Steven E. Harris
--
You re
obvious counterpart to the function `insert-paretheses'.¹
Footnotes:
¹ http://www.cliki.net/Editing%20Lisp%20Code%20with%20Emacs
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo
David Nolen writes:
> Using loop/recur is already the beginning of code smell for anything
> that is not performance sensitive.
[...]
In your arity-overloaded example, is there any runtime cost to figure
out which of the two overloads to choose each time `recur' evaluates?
-
\C-r" 'find-file-read-only)
--
Steven E. Harris
--
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
fi
ielded by CharSequence#subSequence(), as
it already promises to return a CharSequence.
Most Java code poisons its string manipulation efficiency by always
promising to return String rather than CharSequence. You've done better
in your signatures here, so I'm just encouraging you to av
would instead
force one to use a map in cases where such a "key comparison view"
(being something less than the value itself) is necessary.
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, s
n use #(partial put %) for set-state.
Interesting idea.
> PS. Sorry if this is a bit chaotic...
I like the challenge of following your mental process. More examples
on this topic would be welcome.
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Grou
ate monad as an argument to bind, even
> though it doesn't care about the state at all.
Ah, I hadn't realized that such functions -- of which I've now written
several for use in the state monad -- actually say nothing about the
state, and can be used in other monads as well.
T
ion until we receive the state later.
What would be lost by defining Clojure bind operator like this:
(fn m-bind-state [mv f]
(fn [s]
(let [[v ss] (mv s)]
(f v ss))))
Is there more to it than, "Monadic functions must return monadic
values"?
Any clarifying advice would
ou used commute,
the commuted operation could be repeated upon conflict at the end of the
transaction and wind up succeeding, albeit with a different resulting
value than the one observed within the transaction, right?
--
Steven E. Harris
--
You received this message because you are subscribed to
ataggart writes:
> You can use *agent* from inside an agent thread to obtain the
> "current" agent.
Is this documented?
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this gr
esn't have to run again. It's
not clear whether `commute' /always/ invokes the provided function twice,
or only in the case of having detected a conflict against the target ref
at the would-be commit point.
> I think alter is exactly the right tool.
Good. I can understand `alter
#x27; behave. In particular, if a transaction touches
several values with several `alter' or `commute' calls, and any one of
those values wind up conflicting with a competing transaction, does the
whole transaction fail and restart? Again, how do `alter' and `commute'
differ in s
dig through the core
API documentation. Finding `when-not' was nice, but the name still
doesn't work for me. Per your/our macro above, it's not really different
enough from `when' and `not' to warrant another name.
--
Steven E. Harris
--
You received this message because
s habit:
,
| (defmacro unless [pred & body]
| `(when-not ~pred ~...@body))
`
--
Steven E. Harris
--
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 fr
unctions defined?
There's the "dataflow" library in Clojure contrib¹, but it doesn't have
an `update-cell' function or form `>>'. Where are you finding these? Is
there public documentation available?
Footnotes:
¹ http://richhickey.github.com/clojure-contrib/dataf
gmane.org/gmane.comp.java.clojure.user/24894/focus=24956
In the *inferior-lisp* buffer, try evaluating the following form:
(.. java.lang.management.ManagementFactory (getRuntimeMXBean) (getName))
Does that cause SLIME's REPL to finally connect to Swank?
--
Steven E. Harris
--
You received this message b
;) is the inner one.
--
Steven E. Harris
--
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
first post.
To unsu
s when loaded
for the REPL, and hence it can't find the required class (clojure.main),
even though IDEA can load the same Jar file for other reasons.
It's strange and frustrating.
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clo
956
--
Steven E. Harris
--
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
first post.
To unsubscribe fr
James Reeves writes:
> Would those more knowledgable about Clojure care to weigh in on
> whether it be a good idea to create a custom class inheriting from
> IDeref?
That's how promise is implemented, but that's supposed to be an internal
detail.
--
Steven E. Harris
--
uedSynchronizer
so that I could expose timed waits on it, but I got hung up with lack of
access to protected methods in the `proxy' macro.
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send ema
a lot of options and
whichever one you think sounds appropriate is probably the wrong
choice. Be prepared to try several times."
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to cloj
Justin Kramer writes:
> You may find this ns cheatsheet helpful:
>
> http://gist.github.com/284277
That is most helpful.
What's not helpful is the weird mix of lists and vectors used by these
forms. When I finally made it to :rename accepting a map, I had to take
a break.
--
St
influence over
/other/ instances of the same Method. Changing the accessibility doesn't
seem to have global effect throughout the program.
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, se
idden protected methods and
calling on protected methods.
--
Steven E. Harris
--
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 - pl
on a separate thread seems like way too much
work just to get a timeout-based wait on the promise's delivery
arriving.
Footnotes:
¹ http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/deref
--
Steven E. Harris
--
You received this message because you are subscribed
pec/Body/f_wr_pr.htm
http://www.lispworks.com/documentation/HyperSpec/Body/f_format.htm
²
http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_s.htm#stream_designator
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To
er means
of spawning asynchronous work (or not) while still retaining the
block-on-a-latching-result capability.
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googleg
I felt confident enough to ask. Learning was my goal, and
your essays have been tremendously helpful.
--
Steven E. Harris
--
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 post
(fn [v]
| (m-result (f v
`
but it looks too simple.
Footnotes:
¹ http://intensivesystems.net/tutorials/monads_201.html
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email
Phil Hagelberg writes:
> There was some discussion about it a couple months ago:
I picked up the torch today, in hope that others will try again for a
better resolution:
http://thread.gmane.org/gmane.lisp.slime.devel/9178/focus=9383
--
Steven E. Harris
--
You received this mess
Phil Hagelberg writes:
> If someone would volunteer to fix it, I'd be thrilled. Nobody who is
> interested in using CL and Clojure at the same time has stepped
> forward so far, which is why it's currently broken.
Can you characterize what needs to be fixed?
--
Steven
mputational steps.
Can you recommend a book that covers aspects of monads like these? I'd
like to learn more about the abstract concepts than their implementation
in a particular language.
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "
Thank you, Konrad. Your explanation was perfect.
--
Steven E. Harris
--
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
did
try all of this with the git version and found the exact same behavior
as with the CVS version.
--
Steven E. Harris
--
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 th
ould one be able to call on a "lifted" function? A simple example would
help.
--
Steven E. Harris
--
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
ning to delaying evaluation of
the monadic function provided to bind.
--
Steven E. Harris
--
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 moderate
nction. Is that right?
If so, is it the case with all or most monads that the bind operator is
not meant to actually perform computation on the spot, but rather to
compose a delayed computation, or is this delaying particular to the
continuation monad?
--
Steven E. Harris
--
You received this
---
| (f v)
`
should evaluate to a monadic value and be suitable as a return value
from `m-bind'. In short, why is this not an acceptable implementation?
,----
| (fn m-bind-cont [mv f]
| (mv (fn [v] (f v
`
--
Steven E. Harris
--
You received this message because you are subsc
oesn't start up) without the aforementioned
prodding.
--
Steven E. Harris
--
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 -
"Steven E. Harris" writes:
> Now get this: Right before the SLIME-Swank connection completes, Emacs
> beeps and prints the following two lines in the *Messages* buffer:
>
> ,
> | error in process filter: cond: etypecase failed: defun, (number cons string)
&g
Rich Hickey writes:
> Perhaps it would be best to paste such dumps somewhere, rather than
> mail to the entire list?
I'll do that next time. Sorry for the noise.
--
Steven E. Harris
--
You received this message because you are subscribed to the Google
Groups "Clojure" g
"Steven E. Harris" writes:
> In the meantime, I'll continue the investigation.
And yet more information: Apparently it's not critical to call on the
RuntimeMXBean#getName() method specifically to kick the Swank thread out
of its blocking call; just about /any call on
"Steven E. Harris" writes:
> In the meantime, I'll continue the investigation.
Here are two thread dumps of the Java process running Clojure and Swank,
which, at this time, has a live Clojure REPL, but the Swank call to
`connection-info' hasn't completed yet.
This f
different Java versions with the same
> result?
No, that's the only one I have installed. In a few days when I return to
the office, I can try it against version 1.6.0_14 as well.
In the meantime, I'll continue the investigation.
--
Steven E. Harris
--
You received this messag
"Steven E. Harris" writes:
> it takes calling RuntimeMXBean#get() -- actually using the
> RuntimeMXBean instance -- to unblock the other thread.
I meant RuntimeMXBean#getName() there.
My typing is poor this morning.
--
Steven E. Harris
--
You received this message because yo
ure?
Yes. I'm tracking the tip of the "master" branch via Git.
Here's the stack:
o swank-clojure
Git head.
o SLIME
Both CVS head and git://git.boinkor.net/slime.git head behave the same
way, as the offending calls are in swank-clojure.
o Clojure 1.1.0
Downloaded Jar from code.googl
"Steven E. Harris" writes:
> My next step will be to instrument the Swank side to see when
> `connection-info' is being called.
I found the problem: swank.util.sys/get-pid.
It looks like the JMX call to get the PID hangs. If I visit the
*inferior-lisp* buffer's REPL
xt line overwrites that
buffer. The line offered is a read-only /view/ of the mutable
buffer. "Saving" a line for future use hence requires an explicit copy
-- something that's not likely idiomatic in Java or Clojure.
--
Steven E. Harris
--
You received this message because you a
"Steven E. Harris" writes:
> This is the only content in the *slime-events* buffer while I'm waiting
> for the connection to complete:
>
> ,[ *slime-events* buffer ]
> | (:emacs-rex
> | (swank:connection-info)
> | "COMMON-LISP-USER" t 1)
> `
27; per your suggestion.
The Swank back-end didn't dump any exception traces to the
*inferior-lisp* buffer.
The behavior looks like it suffers a race, or maybe the socket
connection request isn't noticed as intended.
--
Steven E. Harris
--
You received this message because you are su
"Steven E. Harris" writes:
> This morning, doing so makes things work much better.
Still I see this in the *inferior-lisp* buffer when starting slime:
,
| (require 'swank.swank)
|
| (swank.swank/ignore-protocol-version "2009-12-23")
|
| (swank.swank/start-serv
still don't work.
--
Steven E. Harris
--
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
first post
efinitions
evaluated there have no apparent side effect on the Clojure REPL
available in the *inferior-lisp* buffer.
I've also noticed that the SLIME "presentations" feature doesn't work
with Clojure. That may be a symptom of the SLIME REPL not meeting up
properly with the Clo
77 matches
Mail list logo