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

2014-07-17 Thread Mark Engelberg
Yeah, you've answered your own question. In practice, I doubt the difference is measurable. Another common idiom you see in Clojure code is: (defn f [xs] (if-let [s (seq xs)] ...do something with (first s) and (f (rest s))... ...base case...)) This ensures that you seq-ify the input (r

Re: unexpected behavior of clojure.core/empty

2014-07-19 Thread Mark Engelberg
As Mike points out, it does seem that MapEntry is considered a collection and is designed to emulate a vector so that you don't really have to worry about whether you have a MapEntry or a two-element vector (and as he points out, in ClojureScript there really is no distinction between a MapEntry an

Re: Clojure on Cloudbees versus Heroku?

2014-07-30 Thread Mark Engelberg
My experience is that Cloudbees' free tier works better than Heroku's and is somewhat easier to deploy (with cloudbees you just upload a war file that you've built on your machine, whereas on Heroku, you are checking files into git which are built server-side, and if the build doesn't quite work pr

Re: Clojure on Cloudbees versus Heroku?

2014-07-30 Thread Mark Engelberg
Yes. On Wed, Jul 30, 2014 at 5:18 PM, Jonathon McKitrick wrote: > Did you deploy clojure apps? > > > On Wednesday, July 30, 2014, Mark Engelberg > wrote: > >> My experience is that Cloudbees' free tier works better than Heroku's and >> is somewhat e

Re: Transducers are Coming

2014-08-07 Thread Mark Engelberg
I'm also curious to understand how the underlying implementation of transducers leads function composition to behave in the reverse order of ordinary function composition. On Thu, Aug 7, 2014 at 8:07 AM, wrote: > Hello, what is the reason for comp to produce two different orderings > depending

Re: Core.logic for boardgames

2014-08-11 Thread Mark Engelberg
I don't see how core.logic would apply here. You might be interested in a Java-based general game playing engine which you can leverage from Clojure. Many take logical descriptions of the game rules in LISP form. http://www.ggp.org/ On Sat, Aug 9, 2014 at 3:51 AM, Robin Heggelund Hansen wrot

Re: How is this code evaluated (question about transdurcers)

2014-08-24 Thread Mark Engelberg
The comp is the same comp as in clojure.core, but the way that transducers are implemented, comp has the effect of chaining them in a left-to-right manner rather than the way it behaves with regular functions. I actually prefer left-to-right composition, but it is somewhat unfortunate that transdu

Re: Books on Functional Algorithms aimed towards undergrad CS?

2014-09-08 Thread Mark Engelberg
Although it's not specifically an "algorithms" book, the book "How to Design Programs" covers a number of important classes of algorithms (sorting, graph searches, etc.), and more importantly, teaches you how to reason about them and how to come up with them yourself. Another great resource is pro

Re: [ANN] Clojure 1.7.0-alpha2

2014-09-10 Thread Mark Engelberg
When I explain to new Clojurists what the ! means, I explain that it calls attention to a mutation function that is unsafe to call inside a transaction. Many programmers coming from Scheme are used to thinking of ! as meaning *anything* involving mutation, but that's not the case in the Clojure.

Re: [ANN] Clojure 1.7.0-alpha2

2014-09-10 Thread Mark Engelberg
I'm curious: how much faster are volatiles than atoms? -- 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 po

Re: (Request) Rich Hickey's EuroClojure 2014 slides

2014-09-11 Thread Mark Engelberg
+1. I also was unable to follow the video without the slides. On Thu, Sep 11, 2014 at 12:36 PM, Leon Grapenthin wrote: > @Alex Miller: It would be great if an exception could be made. Again: The > slides are not in the video. > > Consuming them "in context of the talk" is my intention by openin

Re: pigpen newbie question

2014-09-11 Thread Mark Engelberg
You're probably using Clojure 1.7.0 alpha 2, which introduced a new function called "cat" into the core namespace, which overlaps with a function in instaparse. A couple nights ago, I updated instaparse to version 1.3.4, with an update to deal with this change in alpha 2, but pigpen has not yet be

Re: Clojure terminology

2014-09-11 Thread Mark Engelberg
This whole discussion makes me think you're trying to teach Clojure in a Scheme-like way, which maybe isn't the best approach. In Clojure, it is rare to need quoted lists and symbols. Instead of 'hello, you would use :hello. Instead of '(1 2 3), you would use [1 2 3]. So the whole notion of quoti

Re: Clojure terminology

2014-09-12 Thread Mark Engelberg
Relating to your random thought, note that: => '[(+ 2 3) (+ 4 5)] [(+ 2 3) (+ 4 5)] Probably the only way to make sense out of this is to talk about how every expression is first "read" then "evaluated". You can interactively explore how things are "read" in Clojure with read-string. => (read-st

Re: Clojure terminology

2014-09-12 Thread Mark Engelberg
That's a neat trick! -- 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 unsubscribe from this group

Re: Profiling in Counterclockwise

2014-10-05 Thread Mark Engelberg
I haven't done it in a while so can't give detailed instructions, but it is definitely possible to profile code running in the REPL. The profiler that comes with java allows you to select any java process running on your machine, so you just select the JVM instance that is running the REPL. Then,

Re: Modelling in Clojure

2014-10-16 Thread Mark Engelberg
On Thu, Oct 16, 2014 at 3:49 PM, James Reeves wrote: > > {:name "Alice", :email "al...@example.com"} > > At this point, stop. You have your data model. > > > I think that coming from OO, the most disconcerting piece of Clojure's philosophy is that it is relatively rare in Clojure to publish a

Re: Modelling in Clojure

2014-10-16 Thread Mark Engelberg
Right, my point wasn't just about "data change", it was more specifically about the addition or change of "computed fields". In Clojure, non-computed fields are usually accessed directly by keyword, whereas computed fields require an actual API. This difference in access style complicates things

Re: Modelling in Clojure

2014-10-18 Thread Mark Engelberg
Yeah, it's hard to deny the convenience of Clojure's keyword lookups and standard assoc mechanism for getting and setting stored values, but I think Bertrand Meyer's Uniform Access Principle reflects some pretty deep thinking about the kinds of complications that arise in maintaining large programs

Re: Modelling in Clojure

2014-10-18 Thread Mark Engelberg
I think all of James' points about the proven value of structuring an application primarily around data rather than a complex API are right on point. It is one of the things I love about the Clojure philosophy. But there's nothing about the value of data-driven development that requires data look

Re: Calling empty on a map entry

2014-10-18 Thread Mark Engelberg
See this thread: https://groups.google.com/forum/#!searchin/clojure/unexpected$20behavior$20of$20clojure.core$2Fempty/clojure/z4GiyxvFEqg/zxwTklPa2mEJ -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googleg

Re: CCW bug [SEVERE]

2014-10-25 Thread Mark Engelberg
On Sat, Oct 25, 2014 at 11:19 PM, Fluid Dynamics wrote: > This is a really weird one, when you think about it. How the heck does a > programmer make a mistake that results in the *file save* function going > into an *infinite loop*? At least it didn't go into an infinite loop > filling my filesys

Re: CCW 0.28.1.STABLE001 editor *very* slow when entering docstrings.

2014-11-09 Thread Mark Engelberg
I think a lot of people use the paredit mode which automatically keeps quotes balanced, but as someone who doesn't use paredit, I have also noticed this problem, and agree that it is a nuisance. (It's not just strings, I think, but can occur with other sorts of unbalanced things when typing at the

Re: Accessing Record fields with keywords in ClojureScript not working as in Clojure

2020-08-04 Thread Mark Engelberg
You misspelled default in your defrecord. On Tue, Aug 4, 2020 at 7:42 AM 'clartaq' via Clojure < clojure@googlegroups.com> wrote: > I originally posted > > this on Stack

[ANN] rolling-stones 1.0.2

2021-11-14 Thread Mark Engelberg
https://github.com/Engelberg/rolling-stones rolling-stones is a satisfaction solver, a Clojure wrapper for the SAT4J Java solver. Version 1.0.2 updates the dependency to a newer version of SAT4J, implements a workaround for a memory leak in SAT4J, and introduces a new option to express timeout as

Re: Clojure 1.11 is now available!

2022-03-22 Thread Mark Engelberg
Exciting! Thanks for the new release. Where can I find more information about the new iteration function? The docstring alone isn't sufficient for me to understand how to use it effectively. On Tue, Mar 22, 2022 at 9:22 AM Alex Miller wrote: > You can find an overview here: > https://clojure.or

[ANN] Instaparse 1.5.0

2024-05-29 Thread Mark Engelberg
Instaparse is a library for generating parsers from context-free grammars. https://github.com/engelberg/instaparse The main new feature in this release is support for namespaced non-terminals in your grammar, which become namespaced keywords in the parser's tagged output. Namespaced keywords have

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Mark Engelberg
On Wed, May 25, 2016 at 6:38 AM, Alex Miller wrote: > So something like > > (defn valid-or-explain [spec data] > (let [v (s/valid? spec data)] > (when-not v (s/explain spec data)) > v)) > > Right, that's what I was originally thinking. The form Sean Corfield suggested might make more s

Re: Avoiding nested ifs...

2016-05-26 Thread Mark Engelberg
On Thu, May 26, 2016 at 1:29 PM, John Szakmeister wrote: > > Yeah, cond is definitely useful here, but not in general. > > cond *is* useful in general, just not the cond that is built-in to Clojure. About 5 years ago, Christophe Grand pointed out in a blog post that cond, augmented with a few ex

Re: ANN: Specter 0.11.0, performance without the tradeoffs

2016-05-31 Thread Mark Engelberg
In your writeup, you say that there would be further speed benefits if you could have a global mutable variable within the context of a function (like a static field). Can't you effectively accomplish that already in Clojure like this?: (let [mycache (volatile! nil)] (defn foo [] ...)))

Re: ANN: Specter 0.11.0, performance without the tradeoffs

2016-05-31 Thread Mark Engelberg
I think this is an interesting problem, so here are some additional brainstorms on the issue that may or may not be useful... One strategy to create a global mutable variable from inside the function would be to use def at macroexpansion time to create a var, and then just refer to it in the expan

Re: ANN: Specter 0.11.0, performance without the tradeoffs

2016-05-31 Thread Mark Engelberg
I'm glad it helped! -- 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 unsubscribe from this group,

Deep transients

2016-06-02 Thread Mark Engelberg
Let's say I have an object represented by a series of nested maps: {:a {:b 1} :c {:d 2}} and now I'm going to be making a whole slew of edits to the submaps. To do this efficiently, I need to make all the levels of the map transients, because any update to the inner map also updates the outer ma

Re: [ANN] Flake 0.4.0: Decentralized, k-ordered unique ID generator

2016-06-02 Thread Mark Engelberg
This is interesting. Is it faster than uuid for generation and/or comparing for equality? On Thu, Jun 2, 2016 at 6:03 PM, Max Countryman wrote: > Hi, > > I’m happy to announce a new release of Flake, the decentralized, k-ordered > unique ID generator. > > Flake 0.4.0 includes a number of import

Re: Deep transients

2016-06-02 Thread Mark Engelberg
don't know if it uses transients > under the hood or not, or if you can make it do so, but it seems like a > good fit for the data manipulation problem, at least. > > On 3 June 2016 at 14:43, Mark Engelberg wrote: > >> Let's say I have an object represented by a seri

Re: [ANN] Clojure 1.9.0-alpha5

2016-06-07 Thread Mark Engelberg
Also non-scientific: I personally use BigInteger a fair amount, but have never needed to use BigDecimal. On Tue, Jun 7, 2016 at 9:41 PM, wrote: > As a completely non-scientific data point, we had precisely one place in > our 30k+ lines of code where we can use bigdec? And there is also precisely

Re: What I'm missing in my Instaparse rules?

2016-06-12 Thread Mark Engelberg
Regular expressions are treated with their ordinary Java/Clojure, greedy semantics. Your regular expression for ITEM doesn't exclude whitespace or } characters, so ITEM is matching "Harden }" which leaves no characters left to match your grammar's right curly brace requirement. => (re-seq #"[^\"]

Re: What I'm missing in my Instaparse rules?

2016-06-13 Thread Mark Engelberg
Looks like you left off a + in your regular expression for String. On Mon, Jun 13, 2016 at 2:59 AM, Hussein B. wrote: > Thanks for your help. > > I tried this new grammar to match characters only: > > " > > TEST = OBJECT > > = <#'\\s+'> > > OBJECT = CURLY_OPEN WHITESPACE* STRING WHITESPACE* (WH

clojure.spec - s/and interferes with regular expressions

2016-06-29 Thread Mark Engelberg
I'm having trouble spec'ing out something like this, a function that takes an integer as an input followed by a series of optional keyworded args. :even is an allowed optional keyword, but we definitely want to forbid :odd as an optional keyword. (s/def ::even even?) (s/def ::options (s/and

[ANN] better-cond 1.0.1

2016-07-01 Thread Mark Engelberg
Years ago, Christophe Grand wrote a blog post about how to achieve flatter, clearer, less-nested code by using a special version of Clojure's cond that supported :let clauses (just like Clojure's for comprehensions), as well as :when-let. I've been using that code on a daily basis ever since, copy

Re: [ANN] better-cond 1.0.1

2016-07-01 Thread Mark Engelberg
I should add that Dunaj already has this feature, so if you are a user of Dunaj you do not need this library. -- 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 member

Re: [ANN] better-cond 1.0.1

2016-07-01 Thread Mark Engelberg
Thanks for the pointer to your library, Jason. I hadn't known about it. In response to the interest and questions I've been getting about better-cond, I've added a Rationale section to the README, and I've mentioned your library in that section: https://github.com/Engelberg/better-cond#rationale

Re: [ANN] Release 0.35.0 of Counterclockwise

2016-07-09 Thread Mark Engelberg
Thank you! On Sat, Jul 9, 2016 at 2:09 PM, Laurent PETIT wrote: > Counterclockwise, the Eclipse Clojure development tool. > > Counterclockwise 0.35.0 has been released. > > Highlights: > > - Eclipse Neon Support > > This is the first version which requires Java 8 > > ChangeLog > = > > >

Thoughts on clojure.spec

2016-07-10 Thread Mark Engelberg
I've played around now with implementing specs for a couple of my projects. What I'm finding is that writing specs to check the inputs of a function is easy-ish, but building useful random generators is very hard -- in my projects, this seems too hard to do with any reasonable amount of effort. T

Re: taking my clojure game to a higher level

2016-08-21 Thread Mark Engelberg
Sounds like you are ready for this book: https://www.amazon.com/Clojure-Applied-Practice-Practitioner-Vandgrift/dp/1680500740 -- 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

Re: Two suggestions re: core.spec, `ns`, and clojure 1.9alpha11

2016-08-23 Thread Mark Engelberg
On Tue, Aug 23, 2016 at 7:45 AM, Alex Miller wrote: > We expect Clojure users to become familiar with spec and its output as it > is (now) an essential part of the language. You will see specs in error > messages. > Is there any documentation to help users understand how to interpret the error m

Re: map/filter/remove etc. change underlying structure

2016-09-09 Thread Mark Engelberg
Everything from the Clojure cheatsheet's "Seq in Seq out" section processes the input as a sequence (ignoring its concrete type) and always returns a lazy sequence. When you pass in a vector v, the very first thing these functions typically do is call `seq` on it, and they process the input using

Re: map/filter/remove etc. change underlying structure

2016-09-09 Thread Mark Engelberg
Scala behaves more like your intuition, generally assuming you want back the same kind of collection as what you passed in. It can be a bit of a pain, though, when that's *not* the behavior you want. Clojure's way puts you in control by always producing a sequence and letting you put it into the

Re: [ANN] data-scope - tools for interactively inspecting and visualizing data

2016-09-25 Thread Mark Engelberg
This announcement and the github site list different leiningen injections. Which is correct? Thanks, this looks very useful. On Sat, Sep 24, 2016 at 9:52 PM, James Sofra wrote: > Hi all, > > I have written a little library inspired by Spyscope (which I use a lot) > to provide tools for interact

Re: Idiom question

2016-09-28 Thread Mark Engelberg
A common convention with as-> is to use the symbol $ because it is recognized as a Clojure identifier but looks distinctive, so it stands out as the placeholder of where to thread. Personally, when reading code, I don't really like to see long uses of the threading operator, and I'd argue that if

Re: Idiom question

2016-09-28 Thread Mark Engelberg
Right, and just to take this one step farther, imagine that instead of throwing an error, you wanted to actually return a value. And imagine that your call to MidiSystem/getMidiDeviceInfo might return nil as well, and this is something that needs to be protected against and a value returned accord

Re: [ANN] Clojure 1.9.0-alpha13

2016-09-29 Thread Mark Engelberg
It appears that the recent alphas are incompatible with the Counterclockwise REPL. When I create an empty project in Counterclockwise, using this alpha, then when I try to launch a REPL, clojure.main throws an error saying: Exception in thread "main" clojure.lang.ExceptionInfo: Call to clojure.cor

Re: [ANN] Clojure 1.9.0-alpha13

2016-09-29 Thread Mark Engelberg
This is the line that is broken by the recent alphas: https://github.com/laurentpetit/ccw.server/blob/master/src/ccw/debug/serverrepl.clj#L448 I remember reading somewhere the new alphas have a breaking change to the way :or destructuring works (but I don't remember the details), so I'm guessing t

Re: Just quick review - "idiomaticy" check (Selection sort)

2016-10-10 Thread Mark Engelberg
Doesn't seem fair to use a sort algorithm in the implementation of selection sort. Besides, sort is an n*logn operation, so you don't want to (first (sort-by second ...)) anyway. Instead, choose (apply min-key second ...). Only catch is you need to make sure you don't pass an empty list, or it w

Re: core.async top use cases

2016-10-13 Thread Mark Engelberg
My primary use case for agents has always been when I want to coordinate multiple threads writing to a log file. The agent effectively serializes all the write requests with a minimum of fuss. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post t

Re: core.async top use cases

2016-10-13 Thread Mark Engelberg
lar log file, but I don't actually mutate it, so the mutability doesn't really matter for this purpose. On Thu, Oct 13, 2016 at 7:02 PM, Mark Engelberg wrote: > My primary use case for agents has always been when I want to coordinate > multiple threads writing to a log file. T

Re: comp and partial vs ->>

2016-10-27 Thread Mark Engelberg
On Thu, Oct 27, 2016 at 9:39 AM, Alan Thompson wrote: > I almost never use either the `comp` or the `partial` functions. I think > it is clearer to either compose the functions like Gary showed, or to use a > threading macro (my favorite is the `it->` macro from the Tupelo library >

Re: recursive bindings not available in let form?

2016-12-02 Thread Mark Engelberg
Your "y" could also be "fib". You are permitted to use the same name inside the fn. On Fri, Dec 2, 2016 at 12:59 PM, Walter van der Laan < waltervanderl...@gmail.com> wrote: > AFAIK there are two options. > > You can add a symbol after fn: > > (let [fib (fn y [x] > (cond >

[ANN] Instaparse 1.4.4

2016-12-23 Thread Mark Engelberg
Instaparse is a library for generating parsers from context-free grammars. https://github.com/engelberg/instaparse The big news for this release is that Alex Engelberg has combined the Clojure version with the Clojurescript version of instaparse (initiated by Lucas Bradstreet in 2014) so that movi

Re: Order preservation and duplicate removal policy in `distinct`

2016-12-29 Thread Mark Engelberg
On Thu, Dec 29, 2016 at 1:32 PM, Sean Corfield wrote: > > > I'm just guessing there the answer may just be "equal values are equal > and you should never care which one you get out". There are times to care > though, but then perhaps just don't use `distinct` or be sure to have a > test on it.

[ANN] Instaparse 1.4.5

2016-12-30 Thread Mark Engelberg
Instaparse is a library for generating parsers from context-free grammars. https://github.com/engelberg/instaparse This new release fixes a regression reported in 1.4.4, released last week, involving the application of `insta/parser` to a URL. Also, 1.4.4's new macro `defparser` now properly supp

Re: Cyclic namespace dependencies!

2016-12-30 Thread Mark Engelberg
I feel your pain. I also run up against this time and time again and view it as a significant limitation -- one which often forces me to contort the structure of my Clojure programs into something less natural. And as the Clojure language grows, the problem becomes even more acute. For example,

Re: Cyclic namespace dependencies!

2016-12-30 Thread Mark Engelberg
On Fri, Dec 30, 2016 at 4:38 PM, Timothy Baldridge wrote: > > So the layout looks like this: > > Interfaces.clj > | > > | | > ImplementationA Implementation B > | | >

Re: Cyclic namespace dependencies!

2016-12-30 Thread Mark Engelberg
On Fri, Dec 30, 2016 at 4:55 PM, Timothy Baldridge wrote: > I can see that, and even spec has this use case. In Spec it's solved by > having both A and B in one namespace and using declare to forward-declare > the constructors (or defns in this case). > > So I guess the way I see it the tradeoff

Re: Literal map keys are checked for duplication before evaluation?

2017-01-04 Thread Mark Engelberg
Another workaround: (array-map (java.util.UUID/randomUUID) 1 (java.util.UUID/randomUUID) 2) On Wed, Jan 4, 2017 at 9:16 PM, Timothy Baldridge wrote: > The check is made at read-time, by the time to form gets to the compiler > it's already a hash-map and one of your forms will have been dropped.

[ANN] cloure.math.combinatorics 0.1.4 (with clojurescript support)

2017-01-07 Thread Mark Engelberg
https://github.com/clojure/math.combinatorics clojure.math.combinatorics is a Clojure contrib library for generating permutations, combinations, subsets, selections, and partitions of collections. The new release uses cljc files to provide cross-platform support for Clojure 1.7 and up, and has be

Re: making a tree from map

2017-01-30 Thread Mark Engelberg
Depending on your needs, you may instead want to consider converting your data to a graph data structure, rather than a tree. The benefits are that it will deal properly with cycles, multiple components, or diverging and re-converging paths. Then in graph form you will be able to run a large libr

Re: Contribute Specter to Clojure core?

2017-02-14 Thread Mark Engelberg
I like Specter and would love to have it readily available in any project, so that aspect is appealing. However, there are a handful of subtle ways that Specter doesn't feel like it was designed by the same people who wrote core. For example, Clojure's built-in transformation functions on data st

[ANN] Ubergraph 0.3.1

2017-02-23 Thread Mark Engelberg
https://github.com/Engelberg/ubergraph Ubergraph is a batteries-loaded, immutable graph data structure for Clojure. Version 0.3.1 includes a pull request from github user masztal that now allows `viz-graph`, which is an ubergraph visualization tool using graphviz, to pass along graph-level attrib

Re: Contribute Specter to Clojure core?

2017-03-04 Thread Mark Engelberg
The first time I watched Nathan talk about Specter, I had the exact same thoughts -- "My data structures aren't that complex, I can't relate to these examples, I don't need Specter, I'm fine with Clojure's get-in, update-in, assoc-in." But then, I challenged myself for one day to use Specter's sel

Re: Release date for 1.9

2017-03-06 Thread Mark Engelberg
However, it does mean that libraries depending on 1.9 may be waiting to release so as not to support a Clojure version that can make breaking changes to the new features at any time. On Mon, Mar 6, 2017 at 12:41 AM, Alexander Kiel wrote: > We also run Clojure 1.9-alpha with great success in prod

Re: Navigators and lenses

2017-03-09 Thread Mark Engelberg
Just finished reading through Racket's lens library to compare. Specter can do everything that Racket's lens library can do, but the converse is not true. Specter's navigators can do more than lenses. The lens-like navigators are the most obviously useful parts of Specter, and maybe for some peo

Re: Navigators and lenses

2017-03-09 Thread Mark Engelberg
On Mar 9, 2017 9:52 AM, "Brandon Bloom" wrote: >> > > Since you're responding to me specifically, I'd like to be clear that I never made that claim. I only said we need more experimentation. This is a sufficiently big enough area of ideas to warrant exploration of competing approaches. My comment

Re: Combinatorics partitions that preserves adjacency?

2017-03-15 Thread Mark Engelberg
Think in terms of numbering the possible split locations: a b c 1 2 So the possible partitions are represented by [1], [2], [1 2], i.e., all the non-empty subsets of [1 2]. So write a function that goes from this numbering scheme to partitions (e.g., using subvec) and use combinatorics' subsets

Re: Clojure resume tips?

2017-03-23 Thread Mark Engelberg
On Thu, Mar 23, 2017 at 11:24 AM, Luke Burton wrote: > > * So … if I was in your position, knowing what I know now, if I couldn't > find companies that had very progressive hiring practices, I would make my > resume stand out by leading in with an offer to spend a few hours writing a > small impl

Re: [ANN and RFC] Bifurcan: impure functional data strucures

2017-03-28 Thread Mark Engelberg
I do a lot of work with data structures, so this, I think, would be useful to me. For the immutable data structures, it seems like they could be done as a drop-in replacement for the Clojure built-ins. There are a couple new functions for splitting and concatenating. I'd recommend following prec

Re: Priority Map with efficient search on values?

2017-04-07 Thread Mark Engelberg
On a priority map pm, (.priority->set-of-items pm) will return a sorted map from priorities (i.e., the values in the priority-map) to sets of items that have that priority (i.e., the keys in the priority-map). With that sorted map you can look up specific priorities, or do various subseq operation

Re: Priority Map with efficient search on values?

2017-04-08 Thread Mark Engelberg
If you need to do subseq on the key space, you could do the following: (def pm-empty (PersistentPriorityMap. (sorted-map) (sorted-map) {} nil)) This sets up the priority map to use sorted maps for both associating keys to values and values to keys. Use this as your base priority map to pour new k

[ANN] Ubergraph 0.4.0

2017-06-22 Thread Mark Engelberg
https://github.com/Engelberg/ubergraph Ubergraph is a batteries-loaded, immutable graph data structure for Clojure. Version 0.4.0 includes improved support for serialization/deserialization of ubergraphs. https://github.com/Engelberg/ubergraph#serialization Ubergraph has now been in use for over

Vote for Clojure support in Natural Docs

2017-08-14 Thread Mark Engelberg
Back in the day, I used to use Natural Docs to build great docs for my projects. There's a new version out, and the author of the project is asking people about what languages to support. I encourage you to upvote the Clojure suggestion: https://www.reddit.com/r/NaturalDocs/comments/6trhdo/which_

Re: Sum types in Clojure? Better to represent as tagged records or as variant vectors?

2017-08-23 Thread Mark Engelberg
I usually model sum types as maps with either a :type or :tag key to specify the kind of map it is. Occasionally, I use vectors with the tag in the first position, especially when I need to favor concision, for example, when the data is serving as a DSL with which I will be manually entering a lot

Re: SRSLY? (= (true? identity) (false? identity)) => true

2017-09-01 Thread Mark Engelberg
(true? identity) -> false (false? identity) -> false (= false false) -> true On Fri, Sep 1, 2017 at 8:43 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=> (= (true? identity) (fal

Re: Starting Clojure again

2017-09-06 Thread Mark Engelberg
(let [chars "0123456789ABCDEF"] ...) Replace `reduce` with `apply` to get the performance benefit of using a string builder behind the scenes. On Wed, Sep 6, 2017 at 12:58 AM, Cecil Westerhof wrote: > I want to start using Clojure again. I made the following simple function > to generate a PIN:

Re: Starting Clojure again

2017-09-06 Thread Mark Engelberg
You could do that by calling vec on it. But you'd want to move the whole let clause outside of the defn, so it is only evaluated once, not every time the function is called. But best, as I said earlier, is just to let chars be "0123456789ABCDEF". You can call nth on strings, so this is the most e

[ANN] Instaparse 1.4.8

2017-09-22 Thread Mark Engelberg
Instaparse 1.4.8 has been updated to support a breaking change that was made in Clojurescript 1.9.854, relating to the reader. The change has been tested with Clojurescript versions 1.7.28 and up. No functionality changes, and this update should not matter for Clojure users. Instaparse supports C

Re: Help ship Clojure 1.9!

2017-09-28 Thread Mark Engelberg
On Thu, Sep 28, 2017 at 11:02 AM, Jeaye wrote: > This has been the only issue we've run into with 1.9.0-beta1 ( ticket is > here https://dev.clojure.org/jira/browse/CLJS-2352 ). On our back-end, > all tests are good, but we can't currently use beta1 (or alpha20) on the > front-end, since this iss

Re: Help ship Clojure 1.9!

2017-09-28 Thread Mark Engelberg
o the javascript for its definition of the core hash function, which is nonsensical javascript. So all Clojurescript code is broken by running the new release. On Thu, Sep 28, 2017 at 11:34 AM, Mark Engelberg wrote: > On Thu, Sep 28, 2017 at 11:02 AM, Jeaye wrote: > >> This has be

Re: Help ship Clojure 1.9!

2017-10-02 Thread Mark Engelberg
On Mon, Oct 2, 2017 at 7:55 AM, Stuart Halloway wrote: > Hi David, > > Spec will be in alpha for a while. That is part of the point of it being a > separate library. Can you say more about what problems this is causing? > > Stu > > As a library maintainer, I am forced to upgrade and release my li

Re: [core.spec] Stricter map validations?

2017-10-02 Thread Mark Engelberg
Yesterday, I was checking a map of info submitted via web before putting its contents into a database. To prevent people from spamming the database, it's necessary to make sure there aren't additional keys thrown into the map. It would be nice to have a *convenient *way to express this in spec, t

Re: [core.spec] Stricter map validations?

2017-10-03 Thread Mark Engelberg
On Tue, Oct 3, 2017 at 2:55 AM, Peter Hull wrote: > On puzzler's database example, I would have thought that restricting the > keys that go into the DB should not be the job of spec (since functions may > not be instrumented anyway), but the job of the 'core logic'. Maybe I am > misunderstanding

Re: [ANN] Specter 1.0.4

2017-10-17 Thread Mark Engelberg
Thank you Nathan! On Tue, Oct 17, 2017 at 10:31 AM, Hari Krishnan wrote: > Thanks for the update. It is a great library. Thanks for sharing..I will > update my project. > > > On Tuesday, October 17, 2017 at 9:26:32 AM UTC-7, Nathan Marz wrote: >> >> Specter fills in the holes in Clojure's API

Re: [ANN] Specter 1.0.5

2017-11-16 Thread Mark Engelberg
Thanks! -- 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 unsubscribe from this group, send email

Re: numeric-tower versus clojure 1.9

2018-01-17 Thread Mark Engelberg
Did you put [org.clojure/math.numeric-tower "0.0.4"] in your leiningen project.clj file? On Wed, Jan 17, 2018 at 2:26 PM, Andrew Dabrowski wrote: > Is clojure.math.numeric-tower incompatible with clojure 1.9? The numeric > tower is still at version 0.0.4, 4 years old. WHen I try to use I ge

Re: numeric-tower versus clojure 1.9

2018-01-17 Thread Mark Engelberg
It does use the underscore naming convention: https://github.com/clojure/math.numeric-tower/tree/master/src/main/clojure/clojure/math So I suspect there's something strange about your classpath or the dependencies haven't been downloaded, or something along those lines. On Wed, Jan 17, 2018 at 2:

Re: numeric-tower versus clojure 1.9

2018-01-19 Thread Mark Engelberg
You seem to be requiring the numeric-tower functions into the foobar.core namespace, and then "use"ing the foobar.core namespace from the user namespace and expecting the numeric-tower functions to show up in the user namespace. However, namespaces aren't transitive like that. You need to require

[ANN] Instaparse 1.4.9

2018-04-08 Thread Mark Engelberg
Instaparse is a library for generating parsers from context-free grammars. https://github.com/engelberg/instaparse This new release includes contributions from github users dundalek (bugfix for regexp flags in Clojurescript), HausnerR (improved handling of rhizome dependency which more gracefully

[ANN] clojure.data.priority-map 0.0.8

2018-04-09 Thread Mark Engelberg
ority-maps as well as Clojure's other sorted collections. I hope you enjoy the new functionality and find it useful! --Mark Engelberg -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google

[ANN] Ubergraph 0.5.0

2018-04-09 Thread Mark Engelberg
https://github.com/Engelberg/ubergraph Ubergraph is a batteries-loaded, immutable graph data structure for Clojure. Version 0.5.0 updates ubergraph to match the latest protocol changes in Loom 1.0.0 and above. Ubergraph has now been in use for over three years, and has no open bug reports in gi

Re: [ANN] clojure.data.priority-map 0.0.8

2018-04-10 Thread Mark Engelberg
I just deployed version 0.0.9, which adds a more efficient implementation of reduce-kv. -- 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 - plea

Re: Clojure Games

2018-04-25 Thread Mark Engelberg
I created this game for last year's Hour of Code, using Clojurescript and Phaser: http://robot-repair.thinkfun.com/ On Wed, Apr 25, 2018 at 6:17 AM, Gerard Klijs wrote: > I worked on a snake game, where there is a function form one state to the > next. You can play other client site, which can g

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