Not sure what kind of input you can get, but apply-ing list only on strings
would decompose them, so your function can be written as:
(defn ls [x]
(cond
(string? x)
(apply list (list x))
:else
(apply list x
as '(apply list nil)' will yield '().
Or, you can write i
I've just been trying out Clojail, and ran into a difficulty. Suppose
you make a sandbox:
(def sb (sandbox secure-tester))
and you want to dynamically assemble function calls to run inside the
sandbox. Well, the sandbox takes a quoted expression, so you do
something like this:
(defn function-s
Hi,
without being too deep in clojail and the like...
Try quoting the func and input values to your function-sandbox function.
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroup
Another problem. I have a ":repl-init myproj.something" in
project.clj . Using "lein repl", that namespace gets pulled in just
fine, but not when I do a "lein2 repl". Any idea why? Looks like it
does not even try to load the namespace until I pull it in inside the
repl manually.
Thanks,
Marius K.
On Thursday, March 8, 2012 9:33:04 PM UTC-5, puzzler wrote:
>
> I love these ideas. I think your final comment is especially insightful.
> I have no problem writing Clojure code, I just find it unnecessarily taxing
> to read it. The idea of separating the two, and possibly having a
> read-mod
On Thursday, March 8, 2012 2:19:37 PM UTC-8, mefesto wrote:
>
> If `x` is a list then is the call to `(apply list x)` necessary?
>
Yes, meant to take that out.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojur
This has been a fascinating discussion, thanks to everyone involved.
I do kind of feel like complaining about indentation in Clojure is like
complaining that Ruby has too many parentheses ( shut up, they're
optional!).
I still feel like a big part of 'readability' comes down to personal
preferenc
Keming Labs and Upwind Solutions are sponsoring a trip to the local
rock gym the Friday of Clojure/West, immediately after Richard
Gabriel's talk.
No rock climbing experience required: we're going to be bouldering,
i.e., without ropes, not very high up.
If you would like to come, RSVP with me via e
On 8 March 2012 11:14, Jim - FooBar(); wrote:
> There is a clojure repl for android...
Jim, my goal is to be able to write android apps in clojure. But to
develop an app in clojure on a PC is pain: The android emulator eats a
lot of memory and takes minutes to start, 'ant debug install' takes
abo
Hello,
On 9 March 2012 00:47, Daniel Solano Gomez wrote:
> In general, Android differs from the standard JVM in how classes are
> packed into a JAR.
[..]
ah! thanx for explanation
> Just out of curiousity, which version Android are you testing this on?
terminal++@192.168.178.22:~$ uname -a
Lin
Possible to do I/O without any interop ever being called? No.
Possible to define a standard I/O abstraction that hides the details of the
underlying VM? Yes. But difficult. I/O is a leaky abstraction at the best
of times.
-S
--
You received this message because you are subscribed to the Google
> This has been a fascinating discussion, thanks to everyone involved.
So I've been lurking on this thread for some time, and thought I'd go
and offer my two cents on the topic. While writing clojure-py, I've
been in the unique situation of having to decide which language
features will be implemen
Evan Gamble writes:
> (when-let [a foo]
> (let [b bar]
> (when (even? b)
> (let [c baz]
> (when (> b c)
> (let [d qux]
>(f a b c d)))
>
> becomes:
>
> (let? [a foo :else nil
>b bar :is even?
>c baz :when (> b c)
>
Timothy Baldridge writes:
> For example, this is perfectly valid Python, and something I see
> fairly often in other people's Python code:
>
> print [(x, y, x * y) for x in (0,1,2,3) for y in (0,1,2,3) if x < y]
>
> But personally I consider this sort of code unacceptable.
>
> Instead I
Indeed. Don't pass it the function +, pass it the symbol '+.
On Mar 9, 1:20 am, "Meikel Brandmeyer (kotarak)"
wrote:
> Hi,
>
> without being too deep in clojail and the like...
>
> Try quoting the func and input values to your function-sandbox function.
>
> Sincerely
> Meikel
--
You received th
On Fri Mar 9 02:44 2012, Rostislav Svoboda wrote:
> On 8 March 2012 11:14, Jim - FooBar(); wrote:
> > There is a clojure repl for android...
>
> Jim, my goal is to be able to write android apps in clojure. But to
> develop an app in clojure on a PC is pain: The android emulator eats a
> lot of m
I just want to point out that I incorrectly stated that Clojure generates
abstract stubs for unimplemented protocol methods (or types, for that
matter). In fact, Clojure does nothing about them. For classes to fully
implement interfaces is enforced by the Java compiler, not the JVM.
On Thursday
Yes, it's not supported yet in lein2 because REPL-y doesn't support it yet.
But it's definitely on my plate to knock out soon, along with :prompt
support, although :repl-* options will likely be collapsed into a
:repl-options map.
https://github.com/technomancy/leiningen/issues/432
https://gith
Thank you both! That works.
I'm not sure I understand why, though. From the error message, you
would think it needs fewer steps of evaluation, not more. Meanwhile,
if I do:
(defn non-sandbox [func inputs]
(map (fn [inp] (eval `(~func ~inp))) inputs))
this has no problem taking a function.
Evan Gamble writes:
> (let? [a foo :else nil
>b bar :is even?
>c baz :when (> b c)
>d qux]
> (f a b c d))
Macros like that just make your code so much LESS readable. I now have
to understand the semantics of a bunch of keywords specific to the
macro, their order of oper
Craig Brozefsky writes:
Hi Craig,
> Also, people have been writing lisp for a real long time, and they
> haven't invented a chucklehead macro like let? yet, so prolly not
> really needed to improve the readability...
They have invented `loop' and `format'. ;-)
SCNR,
Tassilo
--
You received t
I find let? useful and readable, as do others. There's a bit of brain-
training necessary to read it, but not a lot. Probably no more than
the keyword clauses of the "for" comprehension. The argument that
decades of Lisp programmers haven't invented this particular
"chucklehead" macro is a bit weak
Hi,
Is there a plan to support namespace-related meta programming
functions such as ns-publics, ns-map etc. in ClojureScript? I was
wondering about at least the ones that we annotate with ^:export in
the CLJS files.
Shantanu
--
You received this message because you are subscribed to the Google
On Fri, Mar 9, 2012 at 3:05 PM, Shantanu Kumar wrote:
> Hi,
>
> Is there a plan to support namespace-related meta programming
> functions such as ns-publics, ns-map etc. in ClojureScript? I was
> wondering about at least the ones that we annotate with ^:export in
> the CLJS files.
>
> Shantanu
>
On Fri, 2012-03-09 at 10:04 -0800, Evan Gamble wrote:
> I find let? useful and readable, as do others. There's a bit of brain-
> training necessary to read it, but not a lot. Probably no more than
> the keyword clauses of the "for" comprehension. The argument that
> decades of Lisp programmers have
Namespaces don't exist at runtime in ClojureScript. That's not likely to
change.
-S
--
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
Tassilo Horn writes:
> Craig Brozefsky writes:
>
> Hi Craig,
>
>> Also, people have been writing lisp for a real long time, and they
>> haven't invented a chucklehead macro like let? yet, so prolly not
>> really needed to improve the readability...
>
> They have invented `loop' and `format'. ;-)
Well maybe the problem of the let? macro is that it is not standard.
If you use standard constructs and I'am proeficient with clojure I'll
understand your code fast. I'll concentrate on understanding your code
relevant for your application and domain. But just adding a few new
constructs specific t
(Sorry for split post).
So I'am not against let? macro of whatever you might need. That why we
have a lisp here. But be sure you really need it/use it. And it is
designed to be intuitive as possible.
On 9 mar, 23:05, Nicolas wrote:
> Well maybe the problem of the let? macro is that it is not sta
The nice thing about Grand's cond macro is that it matches the syntax of
using :let inside for comprehensions, so it looks just like other Clojure
code. In fact, once you've tried it, it feels surprising that it's not
already built into Clojure, specifically because it is so similar to
binding wit
Hello folks!
In light of the recent break-in to the Node.js package hosting site
(https://gist.github.com/2001456), I've decided to bump the priority of
increasing the security on Clojars. I've deployed a fix that uses bcrypt
(http://codahale.com/how-to-safely-store-a-password/) for password
hash
Available soon from Maven Central repository.
List of changes available here:
http://build.clojure.org/job/clojure/357/
-S
--
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
On Mar 8, 3:12 pm, cej38 wrote:
> This is a NOOB question.
>
> Would it be possible to write a library that could do IO without
> resorting to the underlying VM?
I would be suspicious of a cross-implementation wrapper. You'll
probably end up with something as awful as the Common Lisp path API.
Wor
We have now released kibit[1] 0.0.2 to Clojars.
New in this release is
* Leiningen 2.0 support
* Better at finding source code
* More rules
* Marginalia docs[3]
* Lots of small fixes
Kibit is a simple code analysis tool (and leiningen plugin). The
purpose of the tool is to tell its users that "H
Hi all,
The ringMon is Ring middleware that injects single web page into
existing Ring application for monitoring, testing and debugging
purposes. The page provides periodic display of raw JMX data of
interest in hierarchical form. It also displays some derived data such
as CPU load over sampling
Hi Zoka,
That sounds like a great project! I will try it out. The only
suggestion I would like to make right now is that it would probably be
better to push non-SNAPSHOT JARs to Clojars while making a release.
Shantanu
On Mar 10, 11:08 am, zoka wrote:
> Hi all,
>
> The ringMon is Ring middlewar
36 matches
Mail list logo