Re: Datatypes and Protocols update

2010-04-27 Thread Mark Engelberg
Watching Stuart's tutorial, it looks like the automatic factory functions for deftypes have gone away (I'm still working with Clojure 1.1, so haven't had a chance to try the latest changes for myself). I'm going to miss that feature, especially for defrecord, which is now the "common case" construc

Re: clojure 1.2 seq fn enhancement FAQ

2010-04-28 Thread Mark Engelberg
On Wed, Apr 28, 2010 at 2:39 PM, Douglas Philips wrote: > If some function I call uses seq-contains? (so that it can get all the > wonderful seq-ness abstractness clojure offers) I should have to know that > internal detail and not pass in a map or set? or worse, fail to get an > optimization i

Re: clojure 1.2 seq fn enhancement FAQ

2010-04-28 Thread Mark Engelberg
On Wed, Apr 28, 2010 at 10:49 PM, Douglas Philips wrote: > What is the purpose, goal, design-rationale of not making seq-contains? fast > on maps or sets? I think Rich's point is that if seq-contains? is sometimes fast and sometimes slow, then it makes it harder to reason about a program that use

Re: clojure 1.2 seq fn enhancement FAQ

2010-04-30 Thread Mark Engelberg
On Fri, Apr 30, 2010 at 5:18 AM, Laurent PETIT wrote: > While it sounds soo evident now that you say that explicitly ( the > contains? / get pair ), it may be good to reflect that in the docs of > the functions rather than just keep this knowledge here ? Agreed. This explanation of the relations

Re: Pack and unpack

2010-05-07 Thread Mark Engelberg
On Fri, May 7, 2010 at 1:32 PM, Stuart Sierra wrote: > In Clojure 1.2 the core Clojure data structures will all be > Serializable.  You can test this in the current development master > branch. So is binding *print-dup* still the recommended way to serialize, or is there some other standard way t

congomongo memory leak?

2010-05-08 Thread Mark Engelberg
A couple days ago, on IRC, I observed some folks talking about a possible memory leak in the somnium congomongo clojure interface to mongoDB. The discussion suggested that each fetch opens the file without closing it, and pretty soon you get an error. Does anyone know what happened with this? Is

Question about namespaces

2010-05-08 Thread Mark Engelberg
I've seen people say here that it's relatively easy to break up a namespace into smaller components, so I'm wondering if I'm missing something. I'd appreciate some guidance about how to keep namespaces well-organized. In Python, let's say I have a library "mylibrary.py", and from various files I

Testing private functions from another namespace?

2010-05-08 Thread Mark Engelberg
Is there an easy way to use clojure.test to test private functions of one namespace from another namespace? I remember seeing here that there is some sort of trickery one can do to see the private vars from another namespace, but I don't know how easy that is, or how "unsafe" it is in the context

Re: Question about namespaces

2010-05-09 Thread Mark Engelberg
On Sun, May 9, 2010 at 8:01 AM, David Nolen wrote: > If you just need to break up your code into smaller files another technique > is: > > ; me/lib.clj > (ns me.lib) > (load "me/foo") > (load "me/bar") > > ; me/foo.clj > (in-ns 'me.lib) > > ; me/bar.clj > (in-ns 'me.lib) > > I think this solves p

Re: Question about namespaces

2010-05-09 Thread Mark Engelberg
The more I think about this, the more I feel like I don't have a good mental model of what's going on with namespaces/loading/reading/compiling. What is happening when you "load" a file without reading/compiling it (e.g., load-reader or load-file)? How does referring/using match up with those low

Re: Question about namespaces

2010-05-09 Thread Mark Engelberg
I spent the past half-hour experimenting with what happens in Clojure if the ns declaration doesn't match the file name, and what happens if the ns declaration is not at the top of the file. Here's what I've found so far: 1. When you require/use/load a file, Clojure finds it by the filename. 2.

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Mark Engelberg
Are these going to be in their own namespace (clojure.string), or in core? I hope the former, because many of these names (replace, reverse, join, split) are too valuable to be dedicated only to strings. -- You received this message because you are subscribed to the Google Groups "Clojure" group

Re: promoting contrib.string to clojure, feedback requested

2010-05-26 Thread Mark Engelberg
If you're developing a trio, like ltrim, trim, rtrim, wouldn't it be better to call them triml, trim, trimr so that they show up next to each other in the alphabetized documentation? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this grou

core.match

2013-05-16 Thread Mark Engelberg
core.match has been alpha for about two years. I've been itching to use it in real projects for a long time, but with the alpha status, I've been reluctant to trust that it has been vetted for correctness. What aspects are preventing core.match from being ready for prime-time? --Mark -- -- Yo

Re: [ANN] getclojure.org

2013-05-16 Thread Mark Engelberg
Where is it getting the examples from? -- -- 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 unsub

Re: How to: reduce boolean operations?

2013-05-21 Thread Mark Engelberg
Using eval should be a rarity. I'd use (every? identity [false false true]) to do a reduce-and, and I'd use (some identity [false false true]) to do a reduce-or (keeping in mind the latter actually returns nil rather than false). -- -- You received this message because you are subscribed to the

Re: Some feedback on coding style

2013-05-25 Thread Mark Engelberg
The most common way to do this in Clojure is to define your function such that if the input is not in the domain, the function returns nil. Since nil and false are the only "falsey" values in Clojure, you can use ordinary tests to determine if the function returned a result. The idiom that lets y

Re: Some feedback on coding style

2013-05-26 Thread Mark Engelberg
Another possible design choice is to store a domain-testing predicate in the function's metadata. (with-meta (fn [x] ...) {:domain integer?}) (defn is-defined? [f x] (-> f meta :domain x)) -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To pos

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Mark Engelberg
I would be a lot happier with the state of Clojure debugging if, in addition to a stacktrace, I could easily explore the local variables in play when an error was triggered. It was possible to do this in earlier Clojure environments, but the capability seems to have been lost in the transition to

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Mark Engelberg
Yes and no. nrepl ritz lags behind slime, especially in areas such as breakpoints and inspection. On Mon, May 27, 2013 at 3:22 PM, David Nolen wrote: > Doesn't ritz support nrepl? http://github.com/pallet/ritz > > > On Mon, May 27, 2013 at 5:53 PM, Mark Engelberg > wrot

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Mark Engelberg
On Mon, May 27, 2013 at 10:25 PM, Cedric Greevey wrote: > What about add-watch? Can be used with any of Clojure's mutable-value > containers -- atoms, refs, agents, vars. If one is getting set to an > inappropriate value, or you suspect it is, you can attach a watcher to it > that will emit a log

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-27 Thread Mark Engelberg
I'm not sure what your point is. I rely quite a bit on randomly generated tests, and of course, any multithreaded app has nondeterministic elements that can be hard to replicate. For that matter, if you are simply experimenting with new code at the REPL, it might not always be clear what sequence

Re: Future/Promise and not using threads

2013-05-30 Thread Mark Engelberg
According to this article, Clojure does not yet have this facility: http://java.dzone.com/articles/promises-and-futures-clojure This is something that is being worked on and discussed, though: http://dev.clojure.org/display/design/Promises https://groups.google.com/forum/#!topic/clojure-dev/7BKQi9

lein clojars plugin and latest version of leiningen

2013-06-05 Thread Mark Engelberg
I've been using the lein clojars plugin to deploy to clojars with the "lein push" command. It's been working great for me, but today, it's not working. I recently upgraded to the newest version of leiningen, and that's the only major change I can think of since my last deployment, so I'm speculat

Re: Utility libraries and dependency hygiene

2013-06-05 Thread Mark Engelberg
This thread came up right around the time I was considering adding a dependency on rhizome to instaparse to make it easy to visualize the parse trees. Based on the discussion here, I decided it would be a bad idea to include rhizome directly in instaparse's dependencies. Nevertheless, it made sen

Re: Compiler bug?

2013-06-06 Thread Mark Engelberg
Short answer: This is fixed in 1.2.0-SNAPSHOT. Long answer: There was a file in instaparse that had two functions: parser->str and Parser->str On case-insensitive filesystems, the clojure compiler ends up spitting out a bunch of classfiles that correspond to the different functions, and the one

Re: Compiler bug?

2013-06-06 Thread Mark Engelberg
On Thu, Jun 6, 2013 at 4:27 PM, Mark Engelberg wrote: > Short answer: This is fixed in 1.2.0-SNAPSHOT. > To be clear, just change your project file to [instaparse "1.2.0-SNAPSHOT"] and you should be good to go. As a bonus, there are some new perf improvements and features

Re: [ANN] Instaparse 1.1.0

2013-06-10 Thread Mark Engelberg
On Mon, Jun 10, 2013 at 2:13 AM, Frantisek Sodomka wrote: > EBNF syntax for bounded repetition could be just simply A 3*5 and these > are equal: > A? is A*1 > A+ is A1* > A* is A0* > Right now, in the EBNF syntax, numbers are valid non-terminal identifiers. So for example, rather than "S = A B+",

Re: [ANN] Instaparse 1.1.0

2013-06-10 Thread Mark Engelberg
On Mon, Jun 10, 2013 at 2:57 AM, Frantisek Sodomka wrote: > Googling the exception operator: > http://avisynth.org/mediawiki/User:Gzarkadas/EBNF > Exception The effect is the logical negation of the rule > following. For example -"a" becomes ? all characters not equal to a ?. > Yeah, th

Re: [ANN] Instaparse 1.1.0

2013-06-11 Thread Mark Engelberg
Honestly I hadn't yet given it any thought. Thanks for the interest in having it on Clojurescript. Here are a few issues that come to mind: 1. To achieve performance, I've spent time coding custom data structures that implement various Clojure and Java interfaces. I haven't done much with Cloj

Re: [ANN] Instaparse 1.1.0

2013-06-11 Thread Mark Engelberg
Here's another link: http://java-performance.info/changes-to-string-java-1-7-0_06/ -- -- 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 - pleas

Re: [ANN] Instaparse 1.1.0

2013-06-11 Thread Mark Engelberg
On Tue, Jun 11, 2013 at 3:33 PM, Andy Fingerhut wrote: > > I haven't done anything but think about it during commute time yet, but I > had been wondering in how many situations it might be useful to have a > string type that was something like Relaxed Radix Binary trees, in that > they can be conc

Re: [ANN] Instaparse 1.1.0

2013-06-15 Thread Mark Engelberg
On Sat, Jun 15, 2013 at 7:21 PM, Zack Maril wrote: > Why does instaparse not throw errors? Curious about the reasoning behind > this design. > -Zack > I'm not sure what you mean. It does throw errors for certain kinds of invalid grammars and other fatal problems. Perhaps what you're asking is

Re: A* Graphe implementation

2013-06-16 Thread Mark Engelberg
http://clj-me.cgrand.net/2010/09/04/a-in-clojure/ -- -- 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 pos

Re: Offline Clojure docs

2013-06-30 Thread Mark Engelberg
Download here: https://github.com/clojure/clojure/tree/gh-pages -- -- 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 y

core.async - question about close!

2013-06-30 Thread Mark Engelberg
Is close! merely a convenience function to ensure that future puts to a channel will not be permitted, or is it essential to close! a channel so that it will be garbage collected? -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

Re: core.async implemented on top of Pulsar

2013-07-01 Thread Mark Engelberg
I'd love to try this out, but when I follow the getting started directions and add [co.paralleluniverse/pulsar "0.1.1"] to my dependencies, I seem to get a completely different API and namespace layout than what is given in the documentation. Is there a "snapshot" release that contains the latest

Re: clojure.set/union bug?

2013-07-01 Thread Mark Engelberg
Expanding on what Jim said, you don't usually need to convert the keys of a map into a set, because the map pretty much acts like a set of its keys if you use contains? For example, (contains? {:a 1, :b 2} :a) tests whether :a is among the set of keys in the map. I believe that clojure.set's unio

[ANN] Instaparse 1.2.0

2013-07-07 Thread Mark Engelberg
Instaparse is an easy-to-use, feature-rich parser library. The big idea behind instaparse is to make it simple to convert grammars to parsers without needing to know the idiosyncrasies of LL1, LALR, and other esoteric grammar restrictions imposed by most

Re: [ANN] Instaparse 1.2.0

2013-07-08 Thread Mark Engelberg
FYI, there was a dependency problem with 1.2.0, and I've pushed a version 1.2.1 fixing the issue out to clojars. If any further bugs are reported, I will provide further bugfixes under the 1.2 numbering series (1.2.2, etc.), so I encourage you to check back at the github site

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Mark Engelberg
On Tue, Jul 9, 2013 at 9:14 AM, Ray Miller wrote: > Pure. Simple. Beautiful. (Not that I'm the best Scheme programmer ever, > but to me it looks beautiful, and it conforms well to the base of the > problem. You get the point.) > > >> > This is not implementing expt as it is usually known, it look

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Mark Engelberg
On Tue, Jul 9, 2013 at 8:11 AM, Alexander Gunnarson < alexandergunnar...@gmail.com> wrote: > My idea, which is probably very naive, but one which I'm curious about, is: > > *Is it possible to have some sort of set of automatic-optimizing macros that > work on Clojure code to preserve elegance whi

Re: Clojure: Elegance vs. Performance?

2013-07-09 Thread Mark Engelberg
On Tue, Jul 9, 2013 at 9:29 AM, Alexander Gunnarson < alexandergunnar...@gmail.com> wrote: > This is not implementing expt as it is usually known, it looks more like >>> repeated squaring to me. >>> >> >> Agreed. There's a certain irony that the OP declares the code pure, >> simple, and beautiful

Re: Is this idiomatic for a recurring function?

2013-07-09 Thread Mark Engelberg
On Tue, Jul 9, 2013 at 1:22 PM, Denis Papathanasiou < denis.papathanas...@gmail.com> wrote: > (defn get-length-match [my-list target-length counted-length ind] > (let [current-len (count (first my-list))] > (if (>= counted-length target-length) > ind > (recur (rest my-list) targe

Re: lein injections across namespace changes

2013-07-09 Thread Mark Engelberg
I agree, this has also bothered me for a while. It would be really nice if the injections would repeat whenever you change namespace. On Tue, Jul 9, 2013 at 10:41 PM, Russell Mull wrote: > I have a profiles.clj that looks like this: > > {:user > {:dependencies [[org.clojure/tools.nrepl "0.2.3"]

Re: Clojure: Elegance vs. Performance?

2013-07-10 Thread Mark Engelberg
On Tue, Jul 9, 2013 at 11:39 PM, Mats Rauhala wrote: > Clojure people say that jvm doesn't support tco, which it doesn't. So > they implemented a recur macro that turns the function into an > explicitly tcoable function. But, take a look at scala. It can do > (naive) tco optimization without any e

Re: Things get slow if hashmap has 1000 Elements

2013-07-17 Thread Mark Engelberg
This might help: http://clojuredocs.org/clojure_core/clojure.core/*print-length* -- -- 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

Re: Status of Generic Functions (a la lisp)

2013-08-03 Thread Mark Engelberg
What's wrong with the built-in multimethods? -- -- 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

Re: Status of Generic Functions (a la lisp)

2013-08-03 Thread Mark Engelberg
The word "fast" is relative, of course. I've been happily using Clojure's multimethods for a long time. They are certainly fast enough for a wide range of uses. I've seen a couple instances where people used a couple levels of protocols (e.g., one function dispatching on the type of the first ar

Re: [Proposal] Simplified 'ns' declaration

2013-08-05 Thread Mark Engelberg
On Mon, Aug 5, 2013 at 9:32 AM, Lee Spector wrote: > Can you build in a way to get :require :refer :all to work on a bunch of > sub-namespaces together on one line, as one currently can with :use, > without listing each namespace completely on a separate line with a > separate :refer :all? > I

Re: [Proposal] Simplified 'ns' declaration

2013-08-05 Thread Mark Engelberg
On Mon, Aug 5, 2013 at 11:14 AM, Timothy Baldridge wrote: > On that subject when last discussed, it was mentioned that Clojure doesn't > have a import * method because it's basically impossible to implement. > Well, surely the word "impossible" is inaccurate, since other languages (e.g., Scala) d

Re: [Proposal] Simplified 'ns' declaration

2013-08-05 Thread Mark Engelberg
On Mon, Aug 5, 2013 at 11:31 AM, Jonathan Fischer Friberg < odysso...@gmail.com> wrote: I think it's java that is at fault here. I think wildcards should never > have been part of java to begin with. The argument here is basically > exactly the same as why :use shouldn't be used, so I wont explain

Re: Wrong documentation of contains?

2013-08-07 Thread Mark Engelberg
Yes, the discussion about contains? has come up before, but there's a new aspect to this particular instance of the discussion that most of the posts seem to be ignoring. The original poster specifically pointed out that his sequence was constructed by calling the `keys` function on a map: (keys {

Re: IDE feature

2013-08-07 Thread Mark Engelberg
I don't think there's any IDE that does this out of the box, although I'm certain that if you're an elisp hacker, you could easily add this to emacs' clojure mode. I, too, miss that feature from DrRacket. -- -- You received this message because you are subscribed to the Google Groups "Clojure"

Story

2013-08-07 Thread Mark Engelberg
Recently, I discovered the "story" literate programming tool for Clojure, which I prefer to marginalia: https://github.com/jedahu/story I had tried marginalia, but ran into the following problems: 1. Didn't really handle all markdown notations properly, so I had a lot of trouble getting the format

Re: IDE feature

2013-08-08 Thread Mark Engelberg
I've tried paredit several times and dislike it. I found that while editing the code, I spent a lot of mental energy trying to figure out how to edit the code within the constraints of the structure-preserving transformation key combos, which took away from my ability to concentrate on the problem

Re: Story

2013-08-08 Thread Mark Engelberg
I started the post primarily to see if anyone else was using story, and if anyone knew the status of that application, and this has turned more into a discussion about literate programming. That's okay though. I'm very interested in literate programming, and am always looking for a viable toolset

Re: IDE feature

2013-08-08 Thread Mark Engelberg
On Thu, Aug 8, 2013 at 4:50 PM, Norman Richards wrote: > I do stand by comment. You are free to disagree. It's so painful to > watch people (experienced LISPers and newbies alike) manually balancing > parenthesis and spending inordinate amounts of time to do the simplest > tasks like pulling an

Re: [ANN] Leiningen 2.3.0 released

2013-08-08 Thread Mark Engelberg
I'm getting the same error. On Thu, Aug 8, 2013 at 8:47 PM, Frank Hale wrote: > Upgrading failed for me. > > C:\Users\majyk\Desktop>lein upgrade > The script at C:\Users\majyk\Desktop\local\lein.bat will be upgraded to > the late > st version in series 2.3.0-SNAPSHOT. > Do you want to continue (

Re: tools for minimizing forward declaration

2013-08-19 Thread Mark Engelberg
I agree this is a huge pain, although I don't know if I'd call it a "forward declaration" issue as much as it is an issue with Clojure not allowing circular dependencies among modules. Potemkin seems to be the best way to deal with this particular scenario, but I personally think that this is an i

Re: Building Trees

2013-09-08 Thread Mark Engelberg
Rather than describing it in terms of how you'd implement it, can you be clearer about the shape of the data and what specific sorts of operations and queries you need to perform quickly on the data? That would make it easier to brainstorm another way to implement it. -- -- You received this me

Re: Building Trees

2013-09-09 Thread Mark Engelberg
OK, I'm starting to understand the shape of the data better. However, you say, "the ability to arbitrarily look into any node on the tree and then walk up it getting all of the parents until root." What does the query for this look like and specifically what information do you want returned? What

Re: Building Trees

2013-09-09 Thread Mark Engelberg
Let's assume for the moment that you do in fact absolutely need some sort of "bidirectional" querying of the data. In other words, from a parent you need to get to the child, and from the child you need to get to the parent. There's no way to accomplish this with immutable data structures without

Re: Building Trees

2013-09-09 Thread Mark Engelberg
There's one other big downside to the mapping-from-names-to-nodes technique that I forgot to mention. If you plan to delete connections between nodes, and the structure is intricate enough that you don't know whether you can safely delete the node itself, then you can potentially end up with orpha

Re: Set equality bug?

2015-01-23 Thread Mark Engelberg
On Fri, Jan 23, 2015 at 1:10 AM, Luc Prefontaine < lprefonta...@softaddicts.ca> wrote: > Agree, it's broken... in java... > I think it's more frustrating in Clojure than in Java, though, because in Java you have those big, ugly type annotations on every single variable, input and output, so there

Re: Set equality bug?

2015-01-23 Thread Mark Engelberg
If the underlying argument is that it is horribly dangerous to mix floats and doubles in your code, then maybe (<= (float 1.5) (double 1.5)) should have the semantics of (.compareTo (float 1.5) (double 1.5)), i.e., throw an error. I'm not certain that's a good idea for Clojure, but it does seem li

Re: Is Caribou Dormant ?

2015-02-26 Thread Mark Engelberg
I hope Caribou is not dormant. It seems like a powerful tool for building a content management system, and although I haven't personally needed it yet, I really like knowing that something like it is available in Clojure for building that common class of web sites quickly. On Thu, Feb 26, 2015 at

[ANN] clojure.math.combinatorics 0.1.0

2015-03-17 Thread Mark Engelberg
64th permutation (0-based) of "abeiijklmnrrrsstu" Didn't your life feel empty before learning that important fact? Enjoy the new functionality! https://github.com/clojure/math.combinatorics --Mark Engelberg -- You received this message because you are subscribed to the Google Groups

Re: [ANN] clojure.math.combinatorics 0.1.0

2015-03-20 Thread Mark Engelberg
ed (computed directly without iterating through >> the stream). >> >> So now you can easily find out in the blink of an eye, for example, that >> "clojurecombinatoricsrocks" is the 169001484919860315564th permutation >> (0-based) of "abeiijklmnrrrss

Re: Kwargs vs explicit parameter map for APIs?

2015-03-23 Thread Mark Engelberg
Your article makes things a little more complicated than they need to be -- there is a special destructuring syntax in Clojure for pouring keyword args directly into a map (just do the map destructuring after the &). Also, I don't think you need to flatten the map of keyword args before calling "a

Re: Kwargs vs explicit parameter map for APIs?

2015-03-23 Thread Mark Engelberg
Ha! I just noticed that this thread was started a year ago, and I posted a similar comment back then. Well, at least I'm consistent :) On Mon, Mar 23, 2015 at 3:13 AM, Mark Engelberg wrote: > Your article makes things a little more complicated than they need to be > -- there i

Re: Kwargs vs explicit parameter map for APIs?

2015-03-23 Thread Mark Engelberg
Yes, I thought that technique worked, but I just conducted the same experiment as you did and confirmed that it doesn't. I must have been misremembering. You are correct that passing a map to a keyword-arg function is more of a nuisance than it should be. On Mon, Mar 23, 2015 at 4:36 PM, Matchin

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-03-31 Thread Mark Engelberg
I can push a new version of instaparse incorporating Michael Blume's pull request by the end of the day. On Tue, Mar 31, 2015 at 3:57 PM, Alex Miller wrote: > From my perspective, Instaparse is reaching pretty far into the guts > there. I'll talk to Rich about it though. > > -- > You received th

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-03-31 Thread Mark Engelberg
The reason instaparse uses Clojure's string reader is to make sure that strings inside the context-free grammar DSL are handled consistently with Clojure's logic for interpreting strings. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-03-31 Thread Mark Engelberg
Included Michael Blume's pull request in version 1.3.6. On Tue, Mar 31, 2015 at 4:11 PM, Mark Engelberg wrote: > The reason instaparse uses Clojure's string reader is to make sure that > strings inside the context-free grammar DSL are handled consistently with >

Re: [ANN] Dunaj lite, a library-only version of Dunaj

2015-04-13 Thread Mark Engelberg
Thanks for making this easier to use as a library. I find the Dunaj project very inspiring. -- 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 -

Re: any?

2015-04-26 Thread Mark Engelberg
The main use case for the non-boolean aspect of `some` is when you use it to find the first element of a sequence that is in a particular set. (some #{} []) The idea is that when you get a "hit", the return value is the specific element of the *set* that matched. This is a useful trick f

[ANN] Ubergraph 0.1.0

2015-04-29 Thread Mark Engelberg
https://github.com/Engelberg/ubergraph Ubergraph is a versatile, general-purpose graph data structure for Clojure. It is designed to complement and extend Loom, a popular Clojure collection of graph protocols and algorithms. Ubergraph implements all of Loom's protocols and draws them together in

Re: [ANN] Ubergraph 0.1.0

2015-04-30 Thread Mark Engelberg
7;s. Any thoughts there? > > > > > > > On Wed, Apr 29, 2015 at 10:00 PM, Mark Engelberg > wrote: > >> https://github.com/Engelberg/ubergraph >> >> Ubergraph is a versatile, general-purpose graph data structure for >> Clojure. It is designed to

Re: [ANN] Ubergraph 0.1.0

2015-04-30 Thread Mark Engelberg
bout this. > > > > On Thu, Apr 30, 2015 at 1:37 PM, Mark Engelberg > wrote: > >> Ubergraph can certainly represent DAGs, since DAGs are just a special >> case of directed graphs. There is also the function ubergraph.alg/dag? to >> test whether a graph is a DAG.

Re: Clojure needs a web framework with more momentum

2015-05-02 Thread Mark Engelberg
Last week, at the Clojure/West conference, someone (I think it was Brandon Bloom) summed up the general vibe well, by saying something along the lines of, "We now have all the pieces in place to make web development an order of magnitude more productive than in any other language, we just need to f

Re: Clojure needs a web framework with more momentum

2015-05-02 Thread Mark Engelberg
: > On Sat, May 2, 2015 at 8:18 PM, Mark Engelberg > wrote: > >> Clojure is great for creating new, disruptive web models, but what's the >> easiest path to creating something that can be done trivially with, say, >> Drupal or Django? >> > > The questi

Re: Clojure needs a web framework with more momentum

2015-05-03 Thread Mark Engelberg
On Sat, May 2, 2015 at 11:12 PM, Sven Richter wrote: > Reading through all the discussion I don't get which features you are > actually missing. I love luminus and did a lot with it, however, for me it > was missing some standard stuff, that's why I put together closp, which is > just another lei

Re: Why is Caribou unmaintained ?

2015-05-04 Thread Mark Engelberg
There was a thread a while back when (if my memory serves me correctly) one of the creators said the company where Caribou was created is no longer using Clojure, so he didn't think it was likely that he would be adding new features, although he would happily address bug reports. On Mon, May 4, 20

Re: Why is Caribou unmaintained ?

2015-05-04 Thread Mark Engelberg
acted on. There has been some work quite recently on polaris, our routing lib." On Mon, May 4, 2015 at 11:07 AM, Mark Engelberg wrote: > There was a thread a while back when (if my memory serves me correctly) > one of the creators said the company where Caribou was created is no long

[ANN] Instaparse 1.4.0

2015-05-06 Thread Mark Engelberg
Instaparse 1.4.0 is now deployed to clojars and available to use in leiningen projects by adding [instaparse "1.4.0"] to your project file. Instaparse is a convenient way to generate parsers from context-free grammars. The new release features an improved algorithm for handling complex nested neg

[ANN] Ubergraph 0.1.1

2015-05-06 Thread Mark Engelberg
Ubergraph is a recently-released Clojure graph data structure, compatible with Loom and supporting additional functionality: https://github.com/Engelberg/ubergraph In the 0.1.1 release, I added some more convenient ways to manipulate the attribute maps of nodes and edges (add-attrs, remove-attrs,

Re: Why does the following Clojure code take 10x the time the C# version does? How to improve the Clojure version?

2015-05-14 Thread Mark Engelberg
I know that remembering to put "-server" used to be a huge issue, but I thought that on all recent versions of Java on all modern 64-bit machines, -server is now the default. I thought it was a non-issue at this point. Is that incorrect? On Thu, May 14, 2015 at 1:54 PM, Colin Yates wrote: > Pro

Re: Why does the following Clojure code take 10x the time the C# version does? How to improve the Clojure version?

2015-05-14 Thread Mark Engelberg
ct to the other issues (tiered > compilation and whatever else) by default, or with -server, etc. > > -Lee > > > On May 14, 2015, at 4:59 PM, Colin Yates wrote: > > Now I feel even more of an ignoramus :) > On 14 May 2015 21:57, "Mark Engelberg" wrote: > >

Question about sequence with transducers

2015-05-21 Thread Mark Engelberg
According to the website: sequence To create a sequence from the application of a transducer to an input collection, use sequence : (sequence xf (range 1000)) The resulting sequence elements are incremen

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-05-23 Thread Mark Engelberg
I noticed the other day, using beta 3, working at the REPL. Some fairly mundane errors (I no longer remember what they were) were showing up in the stacktrace as Compiler Exceptions which completely threw off my intuition about where to look in my code for those errors. So you're not alone, somet

Re: defrecord, equality, hashing, and performance

2015-06-11 Thread Mark Engelberg
Zach Tellman's potemkin library includes several useful ways to tweak deftypes and defrecords. I wish Clojure itself provided more ways to do this, but in the meantime, potemkin is the best way to create something custom, like a deftype that behaves mostly like defrecord with some different hashin

Re: defrecord, equality, hashing, and performance

2015-06-11 Thread Mark Engelberg
Yes, please vote for that issue. I find myself frequently having to work around this limitation of records in Clojure; I mostly avoid using records directly as a consequence of this performance issue. As a side note, one quick-and-dirty way to get identity semantics for your data is to wrap each

Re: defrecord, equality, hashing, and performance

2015-06-12 Thread Mark Engelberg
So just to explain this a little more, recently I wanted something record-like with custom hashing and equality for my ubergraph library. Unfortunately, you can't do this with defrecord, and starting from deftype and re-implementing all the map-like semantics from scratch is a total pain. So what

Re: defrecord, equality, hashing, and performance

2015-06-12 Thread Mark Engelberg
Related to this, another thing I would like Clojure to provide is an easy way to opt-in for map-like function application for defrecords. Right now, Clojure doesn't implement function application for records, and it is a glaring incompatibility that causes bugs when you switch back and forth betwe

Re: Critiques of "my-flatten" which uses CPS

2014-07-15 Thread Mark Engelberg
Yes, here's the trampolined version which won't stack overflow: (defn my-flatten [xs] (letfn [(my-flatten-cps [xs k] (if (nil? xs) (k '()) (let [x (first xs), ys (next xs)] (if (sequential? x) (recur ys (fn [v] (fn [] (m

Re: Critiques of "my-flatten" which uses CPS

2014-07-15 Thread Mark Engelberg
To avoid the doall-concat, you'd just have the base case return [] (btw, you don't need the apostrophe for vectors or for the empty list), and use `into` rather than `concat`. If you're looking for something that exploits the structure of flatten and uses an accumulator, you could do this: (defn

Re: Critiques of "my-flatten" which uses CPS

2014-07-15 Thread Mark Engelberg
It's worth understanding how to go back and forth between accumulator-style and a lazy construction. You can convert the above non-lazy accumulator version into a similar version that is lazy but has no risk of stack overflow in the realization of that lazy flattened list: (defn my-flatten [xs]

Re: Critiques of "my-flatten" which uses CPS

2014-07-17 Thread Mark Engelberg
Right. Overall lessons: In recursion, the call stack automatically keeps track of what still needs to be done. In Clojure, due to Java, the stack is significantly more limited than heap, so this can be a real limitation. To break free of that limitation, you must somehow keep track of what still

Re: Critiques of "my-flatten" which uses CPS

2014-07-17 Thread Mark Engelberg
On Thu, Jul 17, 2014 at 7:54 PM, Mark P wrote: > > I notice in your lazy version (below), you preface the last cons with a > lazy-seq call, but do not do the same with the other cons calls (within the > first recur form). I know it was only the last line that previously had a > conj call and so

<    1   2   3   4   5   6   7   8   9   10   >