If this is something you do often, spyscope is a library I wrote to
simplify this sort of investigation. You can print an expression by writing
#spy/d in front of it. For more information, you can read
at https://github.com/dgrnbrg/spyscope
On Tuesday, October 15, 2013 10:13:58 AM UTC-4, Brian
On Wednesday, 16 October 2013 01:03:56 UTC+8, Tim Visher wrote:
>
> On Tue, Oct 15, 2013 at 8:15 AM, Mikera >
> wrote:
> > I just created a new, small, experimental library because I needed to
> > represent a "timeline" of values as an immutable object.
>
> This sounds very cool. I've been th
Thanks for all the responses!
This discussion will definitely help me write better code. This was
especially helpful:
over time I've moved to using
> small, private top-level functions instead because I want to focus on
> the names of the _functionality_ rather than the names of intermediate
On Sunday, 13 October 2013 01:21:40 UTC+1, Manuel Paccagnella wrote:
>
> Looks very interesting, thanks for sharing! BTW, documentation is
> impressive and quite comprehensive.
>
> On a related note: I've spotted a couple of typos in your README.md so
> far. Do you accept pull requests for smal
Hi Tim,
Thanks for the feedback.
A. By default, nrepl-jack-in will invoke lein from the directory of the
project that owns the file in the current Emacs buffer. You need to start
Jig from its own project directory, not the project directory of your own
application. Normally I load up Jig's pr
I'm wondering if there are any good tools around for generating schema maps.
I'm looking for a example that can generate the picture from codeq -
https://github.com/downloads/Datomic/codeq/codeq.pdf
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group
Hi Tim.
I've lodged the issue with Raynes here:
https://github.com/Raynes/conch/issues/7
Chris.
--
--
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 mo
Hi Tim.
I've lodged the issue with Raynes here:
https://github.com/Raynes/conch/issues/7
Chris.
--
--
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 mo
On 2013-10-15, at 8:29 AM, Daniel Higginbotham wrote:
> I've been going through On Lisp by Paul Graham and on page 33 he recommends
> against performing "intermediate" bindings. Does this advice hold for
> Clojure? Here are a couple examples:
>
> ;; Common Lisp (from the book)
> (defun bad (x
Brian Craft writes:
> What's going on? Is there some other way to type hint the case with
> the threading macro?
I’m pretty sure this is CLJ-865 “Macroexpansion discards &form metadata”:
http://dev.clojure.org/jira/browse/CLJ-865
In which case you’ll need to use an alternative form of the c
I think the most reliable way to use type hinting is to attach the metadata
to a local binding.
Thanks,
Ambrose
On Wed, Oct 16, 2013 at 1:51 AM, Brian Craft wrote:
> This gives me a reflection warning:
>
> (.write out ^String (-> slist meta :hex))
>
> This does not:
>
> (.write out ^String (:h
My guess would be the ^String is attached to the following expression
in both cases but the macro-expansion process loses that metadata...
On Tue, Oct 15, 2013 at 10:51 AM, Brian Craft wrote:
> This gives me a reflection warning:
>
> (.write out ^String (-> slist meta :hex))
>
> This does not:
>
On Tue, Oct 15, 2013 at 10:48 AM, Sean Corfield wrote:
> On Tue, Oct 15, 2013 at 10:19 AM, Jim - FooBar();
> wrote:
> > wasn't cond-> designed exactly for that?
> >
> > (let [x (some-expression)]
> > (cond-> x
> > (p x) f
> > ((comlpement p) x) g)))
>
> That's uglier than the if :)
>
Als
What about "let-some-expression-if-then-else"?
From: clojure@googlegroups.com [clojure@googlegroups.com] on behalf of Sean
Corfield [seancorfi...@gmail.com]
Sent: 15 October 2013 18:02
To: clojure@googlegroups.com
Subject: Re: is PG's "imperative outsid
This gives me a reflection warning:
(.write out ^String (-> slist meta :hex))
This does not:
(.write out ^String (:hex (meta slist)))
=> (clojure.walk/macroexpand-all '(-> slist meta :hex))
(:hex (meta slist))
What's going on? Is there some other way to type hint the case with the
threading m
On Tue, Oct 15, 2013 at 10:19 AM, Jim - FooBar(); wrote:
> wasn't cond-> designed exactly for that?
>
> (let [x (some-expression)]
> (cond-> x
> (p x) f
> ((comlpement p) x) g)))
That's uglier than the if :)
Sometimes I wish there was a variant of cond-> that took functions
instead of bo
On 15/10/13 18:02, Sean Corfield wrote:
One construct using let that I see in my code quite a bit that I
haven't figured out a cleaner way to express:
(let [x (some-expression)]
(if (p x)
(f x)
(g x)))
wasn't cond-> designed exactly for that?
(let [x (some-expression)]
(cond-> x
On Tue, Oct 15, 2013 at 10:15 AM, Guru Devanla wrote:
> The case you listed is where let binding becomes important so as to not
> perform duplicate evaluation. That is one place the utility of let stands
> out along with its scope.
Yup, exactly. I just see it often enough that I feel that it shou
I know how to write it but I just don't like that name (or any other
I've come up with yet). And I'd probably put the `x` as the last
argument and provide a curried version.
On Tue, Oct 15, 2013 at 10:13 AM, Marcus Lindner
wrote:
> How looks this?
>
> (defn conditional [x condition consequent alt
Sean,
The case you listed is where let binding becomes important so as to not
perform duplicate evaluation. That is one place the utility of let stands
out along with its scope.
For example
Without let bindings:
(if (p (some-expression))
(f (some-expression))
(g (some-expression))
in
How looks this?
(defn conditional [x condition consequent alternative]
(if (condition x)
(consequent x)
(alternative x
(conditional (some-expression) p f g)
Am 15.10.2013 19:02, schrieb Sean Corfield:
Yeah, I found when I first got started with Clojure I tended to use
let for
On Tue, Oct 15, 2013 at 8:15 AM, Mikera wrote:
> I just created a new, small, experimental library because I needed to
> represent a "timeline" of values as an immutable object.
This sounds very cool. I've been thinking about doing something like
this for awhile to support permalinks that will ne
Yeah, I found when I first got started with Clojure I tended to use
let for intermediate named results but over time I've moved to using
small, private top-level functions instead because I want to focus on
the names of the _functionality_ rather than the names of intermediate
_data_. I still use l
I and some of my coworkers do tend to avoid `let` unless in this particular
case you especially want to emphasize the name of something unobvious.
OFten I'd prefer to pull out a new function over using let, or inline the
binding for readability *improvement*.
On Tue, Oct 15, 2013 at 8:18 AM, Raou
Thanks Jonah.
Appreciate the reply, it was very helpful.
On Monday, September 23, 2013 9:03:35 AM UTC+5:30, jonah wrote:
>
> Hi Murtaza,
>
> The short answer is that it's not necessarily that there are pros or cons
> between having components know about each other in their "constructed" vs
if a programming language doesn't have something like 'where', then i
am sad. http://stackoverflow.com/questions/4362328/haskell-where-vs-let
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups
I assume you mean sorted maps? A timeline is pretty much an ordered time ->
event mapping
The main reason for the RRB vectors is the efficient concatenation and
slicing. So you can manipulate large chunks of timeline data. For example -
this is helpful if you are handling long streams of sensor
If you have some idea where to look in your code, or if there isn't much
code, I'd take a look at clojure.tools.analyzer/analyze-ns[1]. The output
is a little overwhelming, but it's pretty easy to navigate in
clojure.inspector. One issue may be finding the call (e.g. to some
clojure.core fn) that c
Wouldn't sorted-set be better than RRB vector in your case?
On Tue, Oct 15, 2013 at 2:15 PM, Mikera wrote:
> Hi All,
>
> I just created a new, small, experimental library because I needed to
> represent a "timeline" of values as an immutable object.
>
> Target use cases:
> - Efficient logging of
Lifting subexpressions up into lets is actually something I do a lot- for
one very important reason: it lets me insert print statements (or logging
statements) showing the value of the subexpression. So I'll do;
(let [ x (subexpression) ]
(main-expression))
because it lets me do:
I certainly prefer giving names to intermediate results with a "let" block:
having good names and breaking the computation up into logical chunks makes
the code much easier to understand and maintain when you come back to it
later.
PG's example though is bad for different reasons - this is actu
Easily done :-) - README updated, the early releases are all on Clojars
https://clojars.org/net.mikera/timeline
On Tuesday, 15 October 2013 21:03:16 UTC+8, Michael Klishin wrote:
>
>
> 2013/10/15 Mikera >
>
>> Repository is here:
>>
>> https://github.com/mikera/timeline
>>
>> Have fun!
>>
>
> It
2013/10/15 Mikera
> Repository is here:
>
> https://github.com/mikera/timeline
>
> Have fun!
>
It would be a bit easier to have fun if there were dependency/installation
instructions provided in README.
--
MK
http://github.com/michaelklishin
http://twitter.com/michaelklishin
--
--
You recei
I've been going through On Lisp by Paul Graham and on page 33 he recommends
against performing "intermediate" bindings. Does this advice hold for Clojure?
Here are a couple examples:
;; Common Lisp (from the book)
(defun bad (x)
(let (y sqr)
(setq y (car x))
(setq sqr (expt y 2))
(list
Hi All,
I just created a new, small, experimental library because I needed to
represent a "timeline" of values as an immutable object.
Target use cases:
- Efficient logging of timestamped events
- Storage of sensor data event streams (Internet of Things etc.)
It's far from finished but I though
Paul Stadig writes:
>> I think that you are worried about the overhead unnecessarily, though.
>> The assert status is checked at macro expansion time. If per module
>> switching on and off is what then I would suggest that you build on top
>> of the existing assert.
>>
>
> There is a huge performa
36 matches
Mail list logo