Is clojure.contrib.* not included with clojure?
I'm reading the book and in chapter two "re-split" doesnt work for me.
I may have missed some instructions- was I supposed to install
something else?
--~--~-~--~~~---~--~~
You received this message because you are
This if off-topic but I'm wondering- is there any reason (doc ...)
returns a URL instead of documentation for special forms?
On Jun 27, 12:29 am, ataggart wrote:
> On Jun 26, 9:12 pm, Four of Seventeen wrote:
>
> > Not that it really matters why it is/was down. The API docs going down
> > for
Is anyone going to OSCON in San Jose in a few weeks? I see this
session:
http://en.oreilly.com/oscon2009/public/schedule/detail/7917
Anything else clojure-related happening?
-justin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Nice code chouser, always nice to see a succinct functional example.
On Dec 13, 10:15 am, Chouser wrote:
> On Sat, Dec 13, 2008 at 10:41 AM, Dmitri wrote:
>
> > I wrote a simple word counter described herehttp://ptrace.fefe.de/wp/
> > it reads stdin and counts the occurrences of words, however
8.0.1 and thought it might be helpful if I document
what I did on the wiki. I also have a small suggestion that the build.xml
file use environment variables instead of hard coded paths to java.home and
idea.home.
Thanks,
Justin
--~--~-~--~~~---~--~~
You received
On Sat, Dec 27, 2008 at 8:55 AM, Peter Wolf wrote:
> Hi Justin,
> This is the right place. Thanks for trying the plugin.
>
> It would absolutely be helpful to document use of the plugin. However, I
> am sure you can tell that it is nowhere near ready.
>
Yes, I noticed there
in\clojure\completions-clojure.xml.txt
E539: Illegal character : complete+=kC:\Program\
Files\Vim\vimfiles\ftplugin\clojure\completions-clojure.zip.txt
Do you have any idea what the problem is?
Thanks,
Justin
On Thu, Jan 1, 2009 at 10:23 AM, Meikel Brandmeyer wrote:
> Dear vimming Clojurians,
>
s . ".txt\""), '\n')
if completions != []
call vimclojure#AddPathToOption('k' . completions[0], 'complete')
endif
endfunction
On Fri, Jan 2, 2009 at 10:58 AM, Meikel Brandmeyer wrote:
> Hi Justin,
>
> Am 02.01.2009 um 17:00 schrieb Justin
It looks like my change below just got rid of the errors. However the
completion functionality is not working. :(
On Fri, Jan 2, 2009 at 1:13 PM, Justin Johnson wrote:
> I got it working by adding double quotes around the path, as can be seen in
> the "let" line of th
ong, or is it just
not working on Windows.
Justin
On Fri, Jan 2, 2009 at 1:22 PM, Justin Johnson wrote:
> It looks like my change below just got rid of the errors. However the
> completion functionality is not working. :(
>
>
> On Fri, Jan 2, 2009 at 1:13 PM, Justin Johnson
>
rward
slashes that would fix it, though I don't know vimscript. :-(
On Fri, Jan 2, 2009 at 2:33 PM, Meikel Brandmeyer wrote:
> Hi,
>
> Am 02.01.2009 um 21:06 schrieb Justin Johnson:
>
> I reinstalled Vim to C:\Vim and reinstalled VimClojure as well. This
>> time I don
Will someone please explain to me why this isn't working? Is there
something special about newInstance that I'm missing?
user=> (. org.tmatesoft.svn.core.wc.SVNClientManager newInstance)
#
user=> (.newInstance org.tmatesoft.svn.core.wc.SVNClientManager)
java.lang.InstantiationException: org.tma
Ah, static methods... Clearly I haven't spent enough time in the Java
world.
user=> (org.tmatesoft.svn.core.wc.SVNClientManager/newInstance)
#
On Mon, Jan 5, 2009 at 8:41 AM, Justin Johnson wrote:
> Will someone please explain to me why this isn't working? Is there
> some
,
but I'm not sure how to do so without having handleDirEntry append them to a
list. Is there a more appropriate way to handle this in Clojure?
Thanks,
Justin
(import '(org.tmatesoft.svn.core SVNException ISVNDirEntryHandler))
(import '(org.tmatesoft.svn.core.internal.wc SV
>From my limited understanding it seems that a lazy data structure must
at some point reify and therefore be cached, to my mind, the
alternative is better describes as a stream or generator.
That is not to say that said stream is not the source of the
reification but that it might be better to k
this time.
I'm new to Clojure and am pretty sure there is an elegant way to do what I
want, but my little OO head is spinning. Any help you can provide is
appreciated.
Thanks,
Justin
=> (def counter (ref 0))
#'user/counter
=> (defn next-counter [] (dosync (alter counter inc)))
#
I found my problem. I wasn't calling agents. I was doing this.
=> (defn next-agent [] (nth agents (next-counter)))
and should have been doing this.
=> (defn next-agent [] (nth (agents) (next-counter)))
Still, I would like feedback. Is there a cleaner way to do this?
Thanks.
Jus
1) (nth
args 2))) arg1 arg2 arg3)
Thanks,
Justin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group,
Ah, that's right! Thank you. I'm having a hard time thinking functionally.
On Wed, Jan 14, 2009 at 12:31 PM, Stuart Halloway wrote:
>
> Hi Justin,
>
> Use apply:
>
> (send-off (next-agent) (fn [v & args] (apply somefn args)) arg1 arg2
> arg3)
>
> Chee
; args] (apply up args))
(str-join "/" [dst-dir p])
IMMEDIATES)
(send-off
a
(fn [_ & args] (apply up args))
(str-join "/" [dst-dir p "branches" "BRANCHNAME"])
INFINITY)))
Thanks,
Justin
--~--~-~--~~---
project is the task), with the call to (apply await agents),
and ending with (shutdown-agents).
Thanks for your response.
Justin
On Wed, Jan 14, 2009 at 5:47 PM, Timothy Pratley
wrote:
>
> Your omission of (apply await agents) is allowing the program to
> terminate before all your creat
On Fri, Jan 23, 2009 at 2:32 PM, Mark Volkmann wrote:
>
> This must be something I learned months ago and then forgot ...
> embarassing!
> What's the easiest way to determine if a sequence contains a given value?
> I thought there would be something like this: (include? [2 4 7] 4) -> true
> That d
Interesting question that I have been pondering myself.
In the absence of specific evidence to the contrary I think that both
languages are worthy of consideration but I think that perhaps the
static typing of scala may be more compelling.
Just my opinion though.
On May 5, 8:11 pm, blais wrote
It looks like anyone with Organizer rights on Clojure's wikispaces wiki
should be able to export an HTML or WikiText backup zip file.
Justin
On Wed, Jul 8, 2009 at 3:23 PM, Raoul Duke wrote:
>
> is there an archive of e.g. http://clojure.org/Reference i can
> download for o
No, same thing. If you go to clojure.wikispaces.com it redirects to
clojure.org, which is hosted at wikispaces.com.
On Wed, Jul 8, 2009 at 5:15 PM, Raoul Duke wrote:
>
> > It looks like anyone with Organizer rights on Clojure's wikispaces wiki
> > should be able to export an HTML or WikiText ba
ailgun Server.
Does anyone have any thoughts on this? Any suggestions?
Thanks,
Justin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googleg
vimclojure group defined. I've joined it now
and will carry on the conversation there.
Thanks.
Justin
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email t
>
> car: "Clojure Archive" (half-assed pun on Lisp's car, plus you can imagine
> the icon!)
>
+1
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegro
You may find this ns cheatsheet helpful:
http://gist.github.com/284277
Justin
On Jan 24, 10:28 am, Manfred Lotz wrote:
> Hi all,
> I'm stumbling about the very basics.
>
> Calling clojure like this:
>
> rlwrap java
> -cp
> /home/manfred/clojure/clojure.jar:
haha It might be a good idea... I was wondering if it was dead as
well. :)
On Feb 26, 4:44 am, dmiller wrote:
> Two factors:
>
> (1) I'm working on deftype/protocols/reify and related things. This
> requires some non-trivial re-engineering of the compiler (based on non-
> trivial reverse-enginee
"\t\n")
Justin
On Mar 20, 8:22 pm, "Mark J. Reed" wrote:
> (I'd say something about my own particular idiom, but that's more of a
> Python thing.)
>
> Anyway, new to Clojure but not to Lisp or Java. Writing something to
> interoperate with some Pe
clojure.contrib.string/partition does exactly what you're looking for.
(require 'clojure.contrib.string)
(clojure.contrib.string/partition #"\s+" "ab c de")
;; ("ab" " " "c" " " "de")
Justin
On May 13, 12:24 pm,
Per Phil Hagelberg's suggestion on IRC, I downloaded and used his
package.el, which fixed the issue for me:
http://github.com/technomancy/package.el/raw/master/package.el
Phil said the bug hasn't been patched upstream.
Justin
On May 17, 4:18 pm, Terrence Brannon wrote:
> Hello
I should note that I wiped out my elpa dir before using the new
package.el. Also, there is this other package.el from Phil's emacs-
starter-kit, which may or may not provide different results:
http://github.com/technomancy/emacs-starter-kit/raw/master/package.el
Justin
On May 18, 11:
Er, to clarify: I believe I wiped out all elpa *packages* before using
the new package.el, not the elpa dir itself.
Good luck,
Justin
On May 18, 12:50 pm, Justin Kramer wrote:
> I should note that I wiped out my elpa dir before using the new
> package.el. Also, there is this other pack
valent to chomp
If clojure.contrib.string/butlast actually mirrored clojure.core/
butlast, it would do the same as chop (c.c.s/butlast requires an extra
arg).
Justin
On May 26, 2:08 pm, Fogus wrote:
> > "chomp" has a clear meaning to anyone who's touched Perl/Ruby/shell-
ce #(assoc %1 %2 %2) {} (range 10))
or
(persistent! (reduce #(assoc! %1 %2 %2) (transient {}) (range 10)))
Reduce is handy for repeatedly assoc'ing into a hash-map.
Justin
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
As Rob mentioned, I won't be doing further development Loom anytime in the
near future. However, if critical mass forms around a fork or alterate
project, I'd be happy to add a prominent link in the readme.
Justin
On Tuesday, June 18, 2013 3:10:23 AM UTC-4, Stephen Kockentiedt wro
(result-set-read-column [date]
(cl/to-local-date-time date)))
Note that result-set-read-column's signature has changed in master; you'll
need to update it to [date _ _] in the next release.
Justin
On Friday, July 5, 2013 4:59:54 PM UTC-4, Colin Yates wrote:
>
> Hi all,
>
&g
iggieback for making
ClojureScript support feasible!
Justin
P.S., Verily, a sister library which Formative uses for validation, now
supports ClojureScript too: https://github.com/jkk/verily
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" grou
clojure.java.jdbc is transitioning to an API that uses explicit passing of
db context - see e.g. the db-find-connection and query functions. The
functions that look for a dynamically-scoped db are deprecated -
e.g., find-connection, with-query-results.
Justin
On Friday, September 6, 2013 8:20
I've used agents, and am familiar with the "reactive agent" concept as
presented on the page http://clojure.org/agents
I just now decided to look into the background of this distinction (as
opposed to the combined state+behavior version of agents that one sees
elsewhere) and am stumped. When I
In fact agents in Scala were the only version I found that were like
Clojure in design.
Beyond the fact that they exist in Scala, and the design goal was to
replicate Clojure's agents, I didn't find that especially informative.
On Tuesday, February 3, 2015 at 6:59:09 PM UTC-8, Leonardo Borges
eself embodied in the agent's responsibility for its
> own synchronization.
>
> Of course, as agents were part of the initial Clojure release, only Rich
> Hickey can give a definitive answer.
>
> On Wednesday, 4 February 2015, Justin Smith > wrote:
>
>> In fact agent
(let [x 0
f #(println x)
x 1
g #(println x)
x 2]
(f)
(g)
x)
there is no mutation of x, only scope shadowing hiding the other binding. Most
functional languages (all that I know) allow shadowing.
--
You received this message because you are subscribed to the Goo
This is excellent, I was just working out something similar myself.
The version using an atom is not idiomatic Clojure, and isn't a translation
of the Haskell version either.
On Thursday, February 12, 2015 at 4:30:02 PM UTC-8, Armando Blancas wrote:
>
> Jorge, I tried this on 1.6 and seemed to w
Considering for the sake of argument the possibility that it is a
legitimate bug, and not a result of misusing the language features, it is a
family of bug that will be more common than most, because it reflects a
style of programming that is rare in real Clojure code.
But it isn't a bug.
Lazy
t;
> So why isn't 4 and any even numbers in the result list? Empty primes'
> allows everything to pass. We are already beyond this. I've already posted
> that even this does not work:
>
> (def primes (cons 2 (lazy-seq (filter #(prime? primes %) (drop 3
> (range))
ef primes (cons 2 (for [n (drop 3 (range)) :when (prime? primes n)] n)))
>
> I really hope the actual developers of the language feel differently. At
> least there's evidence to support that.
>
> Cheers,
>
> Jorge.
>
> Em sexta-feira, 13 de fevereiro de 2
Not unbound primes, primes as (cons 2 ...). If you look at my post above where
I added a print statement to prime? the first 32 inputs see (2) as the value of
primes. 32 is the chunking size of the range function.
--
You received this message because you are subscribed to the Google
Groups "Clo
it's an infinite lazy sequence with itself as a dependency. The first n
elements see a value of the initial non-lazy prefix. The alternative would be a
compilation error.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send em
it's an infinite lazy sequence with itself as a dependency. The first n
elements see a value of the initial non-lazy prefix. The alternative would be a
compilation error.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send em
urse not something
you can simply figure out from first principles, it takes a bit of
exploration and a few mistakes along the way).
On Thursday, February 12, 2015 at 9:05:24 PM UTC-8, Justin Smith wrote:
>
> it's an infinite lazy sequence with itself as a dependency. The first n
&g
People complain about stack traces, but precisely the point of having stack
traces is that if a pre-condition fails, you don't look at the function
with the pre-condition, you look at the function that was calling it.
Duplicating pre-conditions to callers, as a general pattern, would scale
very
one approach would be a multi-method for the condition check that doesn't
enforce the limit on BigInt
user=> (defmulti lucky-numbers-limit type)
#'user/lucky-numbers-limit
user=> (defmethod lucky-numbers-limit :default [n] (< 0 n 1001))
#
user=> (defmethod lucky-numbers-limit clojure.lang.Big
This would make sense because javac isn't used to generate those classes.
On Thursday, February 19, 2015 at 5:08:33 PM UTC-8, Jeremy Heiler wrote:
>
> On February 19, 2015 at 4:40:16 PM, Felipe Gerard (fge...@interware.com.mx
> ) wrote:
> > When you set:
> >
> > :javac-options ["-target" "1.
I'm one of the core devs of the Caribou project.
Caribou has been less actively developed, but I still use it frequently.
We previously were funded to work on Caribou, but the company funding us
decided to discontinue using Clojure (except for supporting some clients
where Clojure code was depl
Consider using for, and returning the new set of values
(for [[a b] (partition 2 1 coll)]
(if (= (:foo a) (:foo b))
(dissoc a :foo)
a))
Here I use partition so that each item can be compared to the one that
follows it. You would likely want a final step that tacks on the last it
I've had issues with JVM GUIs and tiling window managers, sometimes
floating and then tiling the window (or even hiding/ showing the window, or
resizing) will make the contents show up. I don't know if there is an
application level fix for this, and I'm not sure whether it should be
considered
You can use a newer version by putting your nrepl dep under the :dev
profile, which will override the version that leiningen wants.
On Sunday, March 29, 2015 at 11:46:55 PM UTC-7, Tassilo Horn wrote:
>
> Shannon Severance > writes:
>
> > I would like to upgrade nREPL, but it appears I am still u
Emacs can use the native windowing system on every major platform. It still
*looks* like a terminal app, but doesn't have to be one.
Pretty much everything you are saying here doesn't apply to Emacs at all,
and you would know it's all false if you knew anything about Emacs.
On Wednesday, April
Wow, what a thread!
As one of the authors and designers of Caribou, I have a couple of
clarifications to offer.
When the initial post compared contributors and commits, it picked our
"caribou" repo, which, while extensive, holds no code, only our docs. The
actual code is in caribou-core (persi
I'll second the recommendation to use protocols or interfaces to solve this.
Clojure is fairly opinionated in that the tools available should push you
toward developing against interfaces or protocols rather than concrete
implementations. Things become much simpler when you accept this. You can
I use agents instead of atoms when the function altering the value has side
effects, or is especially expensive (and thus should not retry).
I haven't had to use refs yet, but my use case would be if the mutable data
has enough parallel modification that splitting one atomic map into
separate r
Overtone has its own composition logic, but for synthesis it is a client
for the open source Supercollider audio synthesis server (which is a cross
platform C++ program that can be controlled via the network). Pink and
Score are built in Clojure and Java without using an external server.
On Tue
Helping newcomers to the language on #clojure, I often find the need to use
a protocol in reference to it's namespace rather than the namespace of the
datatype extending it is a counter-intuitive one for people learning the
language. Similar with dispatch methods.
Speculatively, I think it has
The usage of delay here is clever. I suggest as an addition, using
`force` instead of `deref` to disambiguate delay vs. atom (of course
if you take a few moments to think about it, swap! shouldn't return an
atom etc., but I think it becomes clearer with force).
On Mon, Jun 15, 2020 at 10:34 AM Ern
I don't think this is true, or if true is incidental to the real problem
% cljs
ClojureScript 1.10.758
cljs.user=> (defrecord Attr [has-default default])
cljs.user/Attr
cljs.user=> (get (->Attr true 1) :default)
1
cljs.user=> (:default (->Attr true 1))
nil
cljs.user=>
On Tue, Aug 4, 2020 at 11:53
not only does clojure.edn accept invalid input, but the clojure reader
also accepts invalid input for the same reason (prioritizing speed of
implementation over validation)
user=> (name 'a/b/c)
"b/c"
On Sat, Oct 17, 2020 at 5:14 PM William la Forge wrote:
>
> My understanding is that run-time va
> The next step might be to investigate why infinite lazy seqs don't print as
> clojure.lang.LazySeq, like the finite ones.
that printing of "clojure.lang.LazySeq@c5d38b66" relies on completely
realizing the input, as it relies on the hash, which relies on the
fully realized value
On Mon, Nov 2
ang.IHashEq
java.util.Collection clojure.lang.IObj clojure.lang.Sequential
clojure.lang.Seqable clojure.lang.IPersistentCollection
clojure.lang.ASeq clojure.lang.IReduce java.lang.Object
clojure.lang.ISeq clojure.lang.IMeta clojure.lang.IReduceInit}
On Mon, Nov 2, 2020 at 12:36 PM Justin Smith wrote:
>
> >
a small suggestion: you don't need to nest let inside let, a clause
can use previous clauses:
(defn get-latest-build
[pipeline]
(let [response (fetch-pipeline pipeline)
json (parse-string (:body response) true)
[pipeline] (:pipelines json)]
(:counter pipeline
also conside
By the time the exception is caught, you are already outside the context of
the Thread which the repl client is interacting with. The default exception
handler has no information tying the executing thread to the repl process
(not to mention the dynamic variables clojure is using to associate outpu
to be clear, in my second example you see the error from the future without
using deref
good luck finding your solution
On Sat, Jan 2, 2021 at 12:50 PM Austin Haas wrote:
> Thank you very much for the explanation, Justin.
>
> I don't see how I can use futures, though, without b
Hi all,
I am working with a client to hire Senior Software Engineers with
experience using Clojure or another functional programming language. If you
are interested please let me know and I can set up a time to connect
directly.
Please see some details:
*What You'll Be Doing:*
- Deliver
there's a handy trick for pulling in the standard repl aliases / refers:
(cmd)user=> clojure.main/repl-requires
[[clojure.repl :refer (source apropos dir pst doc find-doc)]
[clojure.java.javadoc :refer (javadoc)] [clojure.pprint :refer (pp pprint)]]
(ins)user=> (ns foo.bar)
nil
(ins)foo.bar=> (doc
unless this is an exercise in learning clojure, why not use an existing
calculator parser? eg.
https://inst.eecs.berkeley.edu/~cs164/sp05/ta/calculator/Parser.java for a
random example found with a quick google
On Sat, May 15, 2021 at 3:23 PM Blake Watson
wrote:
> Hello,
>
> I've got a situation
> Clojure vars under the IFn interface. In other words, you can only
import Clojure functions, not Clojure values, through that API.
On Fri, Jun 18, 2021 at 12:29 PM ru wrote:
> Thank you, Gary, for the comprehensive answer. I have a control over
> Clojure side, so I decide to add special funct
(sorry, hit reply too soon)
On Thu, Jun 24, 2021 at 9:42 AM Justin Smith wrote:
> > Clojure vars under the IFn interface. In other words, you can only
> import Clojure functions, not Clojure values, through that API.
>
> On Fri, Jun 18, 2021 at 12:29 PM ru wrote:
>
>>
here)
On Thu, Jun 24, 2021 at 9:43 AM Justin Smith wrote:
> (sorry, hit reply too soon)
>
> On Thu, Jun 24, 2021 at 9:42 AM Justin Smith wrote:
>
>> > Clojure vars under the IFn interface. In other words, you can only
>> import Clojure functions, not Clojure values
there's something going on with dynamic bindings here
peregrine.circle=> (let [xs (map #(pr-str %) ["a" "b"])] (println xs))
(a b)
nil
peregrine.circle=> (let [xs (doall (map #(pr-str %) ["a" "b"]))] (println
xs))
("a" "b")
nil
On Tue, May 2, 2017 at 1:55 AM Paulus Esterhazy
wrote:
> Looks lik
The primary suggestion I'd make here is to replace the doseq/reset!
construction in your main loop with reduce using a hash-map accumulator
representing each value you are updating with a separate key. This isn't
just more idiomatic, it also performs better.
Instead of:
(let [hexagrams (atom (sor
pmap is rarely actually useful, but point 1 is false, pmap doesn't require
that it's input or output fit in memory
On Fri, Jun 16, 2017 at 12:52 PM Tom Connors wrote:
> Hello Jose,
> Thank you for the response, but pmap does not address my use case. It's
> insufficient for two reasons: 1) the en
Aside from style issues of mixing channel input/output with program logic,
and hiding the useful return value of go-loop, the real problem here is
doing your work inside a go block. Go blocks are not meant for blocking
tasks, whether CPU or IO bound; doing real work inside go blocks risks
starving
https://www.youtube.com/watch?v=096pIlA3GDo
On Tue, Jun 20, 2017 at 11:44 AM Tom Connors wrote:
> Thanks, Justin. Regarding the mixing of program logic with channel io, I'm
> don't understand why that's a problem in this case or how it could be
> improved. Do you mi
*ns* is a dynamic var, so it points to the current namespace when your
function is running. Most code doesn't switch into a target ns in order to
execute functions from it.
On Tue, Jun 20, 2017 at 4:51 PM Didier wrote:
> Especially given this:
>
> (ns dda.main
> (:gen-class))
>
> (def should-e
Clojure's compiler (there's no interpreter) creates vars for every def
inside a form it compiles. Before the def actually runs it's unbound (as if
you had used declare).
Generally def and defn that are not top level forms are signs of a bad
design. If you need runtime rebinding use a proper mutabl
are "generally" a sign of
bad design. There are of course special cases where they might be the least
bad option.
On Thu, Jun 29, 2017 at 3:15 PM Kaiming Yang wrote:
> Thanks Justin,
>
> Sadly in my case those mutable container will not work because I was
> making a
My first suspicion would be that by the time you access the second element,
you have exited the context of your database transaction, so there's no
data stream available to get it from. Lazyness doesn't tend to mix well
with stateful resources and contexts.
On Mon, Jul 10, 2017 at 9:45 PM wrote:
Oh - this appears to be a separate issue that isn't just about leaving the
context of the db transaction, I don't know enough about those parts of
manifold to address the issue, sorry.
On Tue, Jul 11, 2017 at 1:18 PM wrote:
> Justin, thanks. I'd like to ask a follow up questio
juxt uses each of the functions supplied on all of your arguments. The
hash-map for :what is because (:what {} :default) returns :default - it's
invoking get, which takes an optional "not found" argument.
On Sat, Jul 15, 2017 at 8:52 PM wrote:
> If I do this:
>
> ((juxt :who :what :when) {:who 1
refer-clojure doesn't ever remove mappings, it only adds them
The reason a refer-clojure clause in your ns form can prevent bindings is
because your refer-clojure clause (which is likely more qualified than the
default) overrides the args that ns would otherwise provide to
refer-clojure.
On Sat
You can prevent the need for mutable nodes by using an adjacency list to
represent a graph structure. In clojure this works nicely as a hash-map
from a node id to a set of connected node ids (eg for your case, a set of
parent nodes and a set of child nodes), and traversal becomes a series of
lookup
One important thing to be aware of that I should have mentioned when
suggesting the adjacency list solution is the rationale for using that
representation. When you put atoms in the nodes of your data structure,
it's no longer an immutable data structure and you lose the usage patterns
that clojure
for this sort of logic, I use core.async go blocks containing a call to
core.async/thread, doing some other operation asynchronously with the value
in the channel it returns
(go
(let [result (https://gist.github.com/noisesmith/02ee2ee5dcb8c0290bd8004c4c4d36aa
On Wed, Aug 2, 2017 at 2:09 PM wro
This is what I would expect - the identity function is neither the value
true, or the value false
On Fri, Sep 1, 2017 at 8:44 PM Rostislav Svoboda <
rostislav.svob...@gmail.com> wrote:
> Hi, can anybody explain it please?
>
> $ java -cp clojure-1.8.0.jar clojure.main
> Clojure 1.8.0
> user=> (= (
You seem to be confused about what true? and false? are intended to do.
+user=> (doc true?)
-
clojure.core/true?
([x])
Returns true if x is the value true, false otherwise.
nil
+user=> (doc false?)
-
clojure.core/false?
([x])
Returns true if x is
identity isn't a boolean, so neither true? nor false? should return true
for it
On Fri, Sep 1, 2017 at 9:01 PM Rostislav Svoboda <
rostislav.svob...@gmail.com> wrote:
> > (true? identity) -> false
> > (false? identity) -> false
> > (= false false) -> true
>
> Well:
> (= identity identity) -> tru
To define a method in gen-class you need to use a prefix on the function
name, "-" is the default prefix
On Wed, Sep 6, 2017, 14:41 Cecil Westerhof wrote:
> 2017-09-06 23:27 GMT+02:00 Matching Socks :
>
>> There is a hint, as to this, in the API doc of gen-class:
>>
>>
>> https://clojure.github.
my simplified reproduction of the issue:
+user=> (let [mk-str (fn [] (lazy-seq [(str ["ZiZi"])]))
a (mk-str)
b (mk-str)]
(print-str a)
(pr-str b)
[a b])
[("[ZiZi]") ("[\"ZiZi\"]")]
isn't *print-readably* the difference between pr-str and p
1 - 100 of 282 matches
Mail list logo