Is it possible to load deps.edn dynamically without restarting the REPL in
Clojure 1.9?
--
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 -
r words use a wildcard for :b1.
(get-in {:a [{:b1 "X1"} {:b2 "X2"}]} [:a 0 :b1])
On Sat, Mar 4, 2017 at 1:14 PM, Moe Aboulkheir <m...@nervous.io> wrote:
>
>
> On Sat, Mar 4, 2017 at 6:35 AM, Asim Jalis <asimja...@gmail.com> wrote:
>
>> What might
What might be a Clojurey syntax for doing path navigation? In other words
how could get-in be extended so that it could parse nested vectors like it
parses nested maps? Thinking out aloud, an integer in the path when the
data structure at that level is a vector should treat the integer as an
I wrote a blog post on how to quickly get started with Clojure.
How To Use Clojure For Scripting
http://asimjalis.github.io/blog/2016/12/07/clojure-for-scripting.html
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email
Another option: put the try catch inside the inner loop where you are doing the
failing operation.
> On May 19, 2016, at 5:36 AM, Fluid Dynamics wrote:
>
>> On Thursday, May 19, 2016 at 7:50:57 AM UTC-4, khairul isan wrote:
>> Hello all,
>>
>> I have problem on handle many
are no problems in doing that.
>>
>> Regards,
>> Sunil.
>>
>> On Tue, Nov 3, 2015 at 12:48 AM, Asim Jalis <asimja...@gmail.com> wrote:
>>
>>> Hi Sunil,
>>>
>>> Here is something to think about. Can you use the REPL for your workfl
for asking.
> Regards,
> Sunil.
>
> On Mon, Nov 2, 2015 at 6:09 AM, Asim Jalis <asimja...@gmail.com> wrote:
>
>> Hi Sunil,
>>
>> I am wondering why you want to speed up lein uberjar.
>>
>> How frequently do you need to run this?
>>
>>
Hi Sunil,
I am wondering why you want to speed up lein uberjar.
How frequently do you need to run this?
What is your use case and workflow around this?
Thanks.
Asim
On Mon, Oct 26, 2015 at 2:04 AM, Sunil S Nandihalli <
sunil.nandiha...@gmail.com> wrote:
> Hi Everybody,
> My lein uberjar
On Wednesday, June 18, 2008 at 4:32:01 PM UTC-7, kyle smith wrote:
>
> Is it possible to automatically convert java code to clojure? If so,
> would someone like to volunteer to write it?
I frequently want to quickly translate code snippets from Java to Clojure
to test out an API.
For
(def $1 $2)/;
s/\s+\)/)/g; # Cleanup
print qq{$_\n};'
On Sat, Oct 31, 2015 at 1:35 PM, Asim Jalis <asimja...@gmail.com> wrote:
> On Wednesday, June 18, 2008 at 4:32:01 PM UTC-7, kyle smith wrote:
>>
>> Is it possible to automatically convert java code to cloju
atus))
On Sat, Oct 31, 2015 at 1:37 PM, Asim Jalis <asimja...@gmail.com> wrote:
> The code got mangled in the posting. Here it is again.
>
> TEST=$(cat <<"END"
> String key1 = "";
> String key2= "";
>
I have been using lein-exec a lot for writing quick Clojure scripts. I like
it because:
- It lets me use deps to pull in dependencies from the REPL.
- It makes it easy to get started without creating a lot of stuff.
The problem I am running into is this.
I want to share these scripts with
Hi Kyle,
DNSJava is a stable implementation of DNS in Java.
http://www.dnsjava.org/
Here is the JavaDoc for doing DNS lookups:
http://www.dnsjava.org/doc/org/xbill/DNS/Lookup.html
Asim
On Tue, Sep 15, 2015 at 3:34 PM, Kyle Sexton wrote:
> Does anyone have a recommendation
Hi Laurent,
For refreshing the browser, I call (.reload js/location) from the browser
REPL.
So this is the workflow:
Terminal 1: lein cljsbuild auto dev
Terminal 2: lein trampoline cljsbuild repl-listen
Browser: localhost:9000/myapp.html
1. I make change to the CLJS file.
2. cljsbuild auto
For validation check out Bouncer [1][2]. It is elegant and minimal, and
also lets you chain together validators using the threading macro.
[1] https://github.com/leonardoborges/bouncer
[2]
http://www.leonardoborges.com/writings/2013/01/04/bouncer-validation-lib-for-clojure/
Asim
On Sunday,
I believe this is what clj-tuple is doing under the hood with macros.
On Aug 26, 2013, at 10:38 AM, Kevin Downey redc...@gmail.com wrote:
A Tuple protocol that defines get0 get1 get3 etc for fast element access
that doesn't tie you to using field names might be a good idea.
On 8/25/13 9:35
The area code suggests Seattle, WA.
On Aug 2, 2013, at 2:14 PM, Marcus Blankenship mar...@creoagency.com wrote:
Unless that doesn't matter…
On Aug 2, 2013, at 12:27 PM, Andrew Stine illuminati1...@gmail.com wrote:
Might help if you said what part of the world you're in.
On Friday,
I am planning to write a practical Clojure ebook for beginners, if there is
an interest in this.
If you want to get updates when it is finalized drop me an email.
The goal will be to help people get productive in Clojure quickly, and
start using it to solve real-world problems.
I have taught
*How To Become Productive in Clojure*
You have wanted to learn Clojure for some time. You have been meaning to
use Clojure to get into Lisp and functional programming. So you find some
Clojure tutorials and decide to write a short program. You get your coffee,
fire up your machine, and are ready
This is a good workaround—however, I still wish repl-utils/show was still
there. It was nice to always have it there instead doing this defn every
time I need it to explore a Java API.
On Sat, Feb 11, 2012 at 6:30 PM, Michał Marczyk michal.marc...@gmail.comwrote:
On 11 February 2012 10:35, Ken
I tried to run this using
git clone git://github.com/Yakulu/cyasus.git
lein deps
lein run
And got a failure with this exception:
Exception in thread main java.lang.ClassNotFoundException: cyasus.config,
compiling:(cyasus/common.clj:8)
Did you forget to check in a file? Also do you
Is there a way to exit the ClojureScript REPL? None of these worked:
Ctrl-D, exit. (exit 1), quit, (quit 1). So eventually I killed the window.
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
Thanks! Just realized it says that when the prompt starts—I hadn’t noticed
it.
On Mon, Dec 10, 2012 at 1:47 PM, Devin Walters dev...@gmail.com wrote:
cljs/quit
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
On Thu, Dec 6, 2012 at 5:40 AM, Stuart Sierra
the.stuart.sie...@gmail.comwrote:
The data.generators library has versions of these functions that use a
fixed seed and a rebindable Random instance.
https://github.com/clojure/data.generators
Looking at
I frequently find myself passing around maps that are basically structs. I
use this macro to destructure the fields into let variables.
; Macro.
(defmacro def-fields [struct-name fields]
(let [field-symbol-vector (- fields (map name) (map symbol) vec)
arg (gensym)
body
Is there a way to reimport a Java class into the REPL?
This would be very useful in dynamically developing Java code from the REPL.
Here is a specific example.
Create a java class:
cat 'END_OF_FILE' chk.java
public class chk {
public String hello() {
return Hello from chk (v1).;
}
}
user= (defn f [[x]] (println computing x: (inc x)) (vector (inc x)))
#'user/f
user= (- (iterate f [0]) (take 0))
()
user= (- (iterate f [0]) (apply concat) (take 0))
computing x: 1
computing x: 2
computing x: 3
()
user= (- (iterate f [0]) (mapcat identity) (take 0))
computing x: 1
computing x: 2
Nice. Are there any technical reasons this isn't the default
implementation of mapcat in Clojure.core?
On Mon, Aug 22, 2011 at 9:27 AM, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
Am 22.08.2011 um 16:32 schrieb Asim Jalis:
Is there a way to rewrite mapcat (or apply concat) so that they don't
I am trying to push a Clojure app on Heroku. I have a local jar file
that the app needs. How can I get lein to use the local jar?
When I have local jar dependencies on my personal machine I just
install the jar into the local maven repository on the machine. It's
not obvious to me how to do this
Is it possible that the new function called portal is overwriting the
namespace called portal? Could you try renaming the function called
portal to something else? Like portal2?
On Wed, Jul 27, 2011 at 6:05 PM, Anthony Grimes disciplera...@gmail.com wrote:
That's actually what I thought at
Just saw this neat ClojureScript demo, which can be used as a starting
point to create a Javascript game.
http://jng.imagine27.com/articles/2011-07-23-101007_clojurescript_demo_convex_hull.html
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post
On Sat, Jul 16, 2011 at 9:16 PM, Alan Malloy a...@malloys.org wrote:
On Jul 16, 7:11 pm, Asim Jalis asimja...@gmail.com wrote:
I've been using assoc-in and dissoc-in to navigate through nested
associative structures (HTTP requests). Had some questions:
1. Why doesn't dissoc-in take multiple
Is there an easy way to increase the indent of pprint data structures
from 1 to something like 2 or 4? I've been searching on Google and
going through the docs and don't see anything.
For example, I would like the following command to produce something
closer to output 2 than to output 1.
seancorfi...@gmail.com wrote:
On Sat, Jul 16, 2011 at 12:46 PM, Asim Jalis asimja...@gmail.com wrote:
Is there an easy way to increase the indent of pprint data structures
from 1 to something like 2 or 4? I've been searching on Google and
going through the docs and don't see anything.
For example, I
I've been using assoc-in and dissoc-in to navigate through nested
associative structures (HTTP requests). Had some questions:
1. Why doesn't dissoc-in take multiple key-sequences? For example:
(dissoc-in m [:a :b :c] [:a :b :d])
I can do this using a series of dissoc-in calls, but it might be
Okay. I see what you mean.
On Jul 16, 2011, at 8:39 PM, Sean Corfield seancorfi...@gmail.com wrote:
On Sat, Jul 16, 2011 at 7:05 PM, Asim Jalis asimja...@gmail.com wrote:
The position of the braces might be a red herring here. I was mostly
interested in figuring out how to increase
Is there a way to convert a large HTML document to a vector notation.
So something that converts n1 a1='v1'n2Hello/n2n1 to [:n1
{:a1 = v1} [:n2 Hello]].
I am using hiccup to generate HTML and need a way to convert existing
HTML templates to the hiccup format.
Thanks!
Asim
--
You received this
On Tue, Jul 5, 2011 at 6:35 AM, Stephen C. Gilardi squee...@mac.com wrote:
I would argue that the ~/.m2 repository is nearly as easy to work with as any
other local, on-disk scheme one might envision and has the benefit of working
with any maven-compatible tool.
It also works for arbitrary
I have been using the Clojure REPL to debug a large Java server app.
It's great for exploratory testing and for validating assumptions
about how the system works. I wanted to post the code here in case
someone else finds this useful.
1. Stick this in a class that is loaded early in the
Frequently I want to use the thread macros (- or -) except I need
to thread the arguments into positions other than the first and the
last. Or sometimes I have to go back and forth between first and last
positions. Instead of alternating between - and - and creating
nesting, I've been using this
Here is an example of using this:
(-- hello world (.toUpperCase _) (.toLowerCase _) (.indexOf _ w))
On Tue, Jul 5, 2011 at 3:50 PM, Asim Jalis asimja...@gmail.com wrote:
Frequently I want to use the thread macros (- or -) except I need
to thread the arguments into positions other than
).
The best solution I could come up with involved using a new feature from
lein 1.6.0-SNAPSHOT (:extra-classpath-dirs).
I would be very interested in other options for declaring a dependency on
tools.jar in a leiningen project!
Regards,
Johan
On Wed, Jun 15, 2011 at 7:55 PM, Asim Jalis asimja
Hi,
I am trying to get swank-inject to work on Ubuntu Linux and I am
getting a failure related to tools.jar (ClassNotFoundException:
com.sun.jdi.Bootstrap jdi.clj: 1). This error does not go away even if
I add tools.jar directly to CLASSPATH.
Has anyone seen this error before? Any ideas on how
I tried this also and it works quite well. Do you have any pointers to
information on how to access the datastore on Heroku through Clojure?
The documentation seemed sketchy on their non-Ruby offerings.
Thanks.
Asim
On Tue, Jun 7, 2011 at 9:37 PM, Sean Corfield seancorfi...@gmail.com wrote:
I
Is there an easy way to download Clojure libraries from Git and to
play with them in the repl?
It looks like all of them expect to be downloaded using leiningen, and
leiningen requires creating a project, with dependencies on specific
libraries.
It would be nice if I could do something like:
4, 2010 at 6:23 AM, Asim Jalis asimja...@gmail.com wrote:
Is there an easy way to download Clojure libraries from Git and to
play with them in the repl?
It looks like all of them expect to be downloaded using leiningen, and
leiningen requires creating a project, with dependencies on specific
On Sat, Nov 27, 2010 at 5:53 PM, Benny Tsai benny.t...@gmail.com wrote:
If you don't mind, I would love to see your version with lazy-seq and
recursion. Seems like that's the idiomatic way of solving problems
like this, judging by the source for the partition functions.
Hi Benny,
Certainly.
Here is partition-before and partition-after -- partition-after is simpler.
(defn partition-before-internal [pred coll]
(let [first-item (first coll)]
(if (nil? first-item) ()
(letfn [(get-partial-partition-with-item []
(let [partial-partition (partition-before-internal
This looks like map rather than foldr.
On Sun, Nov 28, 2010 at 7:40 AM, tpeng pengt...@gmail.com wrote:
i have a one:
(defn lazy-foldr [f coll]
(lazy-seq
(if-let [[x xs] coll]
(cons x (lazy-foldr f xs)
it seems works so far ;-p
On Nov 28, 4:01 pm, Laurent PETIT
On Sun, Nov 28, 2010 at 1:17 PM, Ken Wesson kwess...@gmail.com wrote:
The implementation I posted earlier appears to fit the contract of
your partition-before (and, additionally, works properly if the input
starts with (nil ...) :)).
Good catch :) I should have used (empty? coll) instead of
I want to partition a sequence based on the values of a predicate so
that every true starts a new sequence in the partition. Here is an
example of how partition-with could be used:
(partition-when true? '(true false false true false true true))
- '((true false false) (true false) (true) (true))
On Fri, Apr 16, 2010 at 2:15 AM, Per Vognsen per.vogn...@gmail.com wrote:
What may confuse is that map destructuring swaps the positions of keys
and values as compared to map literals:
user (let [{x :body} {:body 42}]
x)
42
It does conform to the pattern that the bound variable
Is this a bug?
echo hi | java -cp $HOME/jars/clojure.jar clojure.main -e '(println
(line-seq (java.io.BufferedReader. *in*)))'
The output is nil.
This works fine if argument to -e is saved to a file and then the file
name is specified on the command line.
--
Asim
--
You received this message
53 matches
Mail list logo