Re: Navigators and lenses

2017-03-09 Thread Brandon Bloom
> > But I don't agree at all with the claim that Specter is some sort of > offbeat, ill-researched version of lenses. > 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 are

Re: Navigators and lenses

2017-03-08 Thread Brandon Bloom
A big one I forgot: RDF's query language SPARQL: https://www.w3.org/TR/rdf-sparql-query/ On Wednesday, March 8, 2017 at 5:35:42 PM UTC-8, Brandon Bloom wrote: > > Responsible adults sometimes needs to access and modify deeply nested data >> structures > > > So far, m

Re: Navigators and lenses

2017-03-08 Thread Brandon Bloom
> > Responsible adults sometimes needs to access and modify deeply nested data > structures So far, my experience has been that it is almost always better to build a pair of flattening and unflattening transforms on the data. Especially since you frequently want only one flattening, but poten

Re: Thoughts on clojure.spec

2016-12-06 Thread Brandon Bloom
I was just very surprised to discover my :ret specs were not being checked via instrument. I've read the rationale above, but I'm not yet convinced. While of course I can (and will) use spec/assert from a post condition, I lose the nice selective instrumentation features. I'd also like to make

Re: clojure.spec & protocol fn

2016-06-06 Thread Brandon Bloom
Just guessing from past experience in the Clojure internals: Instrumenting protocol methods it likely possible, but unlikely to be worth the effort. There are already a bunch of places where protocol functions are different. The accepted convention is to always wrap a protocol method with a nor

Re: Is there an apply-able new?

2016-05-27 Thread Brandon Bloom
The new operation intentionally demands a statically knowable type to construct. While this is true of Java as well, it's not true of JavaScript. However, it is true of the Google Closure compiler's "type system" for advanced compilation. That said, if the library you're using isn't going to be

Re: What is "best practice" regarding transducers

2015-05-10 Thread Brandon Bloom
> > If you have a public project on Github that is using transducers, would > you please point me to it? I would like to see what you did. > Fipp's Clojure 1.7 tuned-up engine uses transducers to emulate mapcat(-with-state), while minimizing intermediate object allocations. Reducers was used

Re: [ANN] Fipp 0.6.0 release: Clojure 1.7 and experimental ClojureScript support

2015-05-10 Thread Brandon Bloom
he fastest game in town, and its simple/easy generic engine is available for your use and abuse. Cheers, Brandon On Sunday, May 3, 2015 at 11:01:19 AM UTC-7, Brandon Bloom wrote: > > Fipp is a better pretty printer for Clojure (and now/soon ClojureScript!) > > https://github.com/brando

[ANN] Fipp 0.6.0 release: Clojure 1.7 and experimental ClojureScript support

2015-05-03 Thread Brandon Bloom
Fipp is a better pretty printer for Clojure (and now/soon ClojureScript!) https://github.com/brandonbloom/fipp Please give it a try and let me know how it goes. Version 0.6.0 includes... - Several nice performance improvements via Transducers - A totally rewritten Edn printer with tagged literal

Re: Different behavior for .cljc file?

2015-05-02 Thread Brandon Bloom
Short version: Old version of the lib was on the classpath. Longer version: `lein with-profiles -user whatevertask` to disable the user profile apparently doesn't work. I was using: export CLASSPATH=$(lein with-profiles -user classpath) java clojure.main Figured I had ruled out my tools, since

Re: [ANN] Clojure 1.7.0-beta2

2015-05-02 Thread Brandon Bloom
Upgrading a couple of projects to 1.7 seems to have gone quite smoothly. Thanks! However, I've encountered some problems with new features, like .cljc files. Please see https://groups.google.com/forum/#!topic/clojure/TrYkq1lUuZw Cheers, Brandon On Friday, April 24, 2015 at 11:27:34 AM UTC-7, A

Different behavior for .cljc file?

2015-05-02 Thread Brandon Bloom
Hi Clojure 1.7 folks, I'm trying to port Fipp to ClojureScript with .cljc files and feature expressions. My first step was to rename files from .clj to .cljc, but doing that broke my code. I'm not exactly sure what's wrong, but before I dig any further Is simply renaming .clj to .cljc file

Re: The Essence of ClojureScript Redux

2015-01-04 Thread Brandon Bloom
Awesome! Seems like there is an opportunity for a cljs command line tool and some packaging gurus out there to package it up for brew, apt, etc. Would be super nice to have a quick repl by running `cljs` or scripts with `#!/usr/bin/env cljs` up top. -- You received this message because you ar

Re: reduced doesn't work inside reductions

2014-11-28 Thread Brandon Bloom
For reference, here's the ticket: http://dev.clojure.org/jira/browse/CLJ-1185 And the commit: https://github.com/clojure/clojure/commit/b45b067f56c78b8128f57913e662d9638ee480c5 On Friday, November 28, 2014 11:19:41 AM UTC-5, Nicola Mometto wrote: > > > This has already been fixed, and reductio

Re: Modelling in Clojure

2014-10-20 Thread Brandon Bloom
> > Well, the question is, where does this additional complexity come from. > In Java, it results in enormous quantities of boilerplate get/set > methods. In Scala, these are autocoded away. > Boilerplate isn't complexity: It's inefficiency. I'll grant that it creates complexity-potential-ene

Re: Modelling in Clojure

2014-10-18 Thread Brandon Bloom
> > I don't know who is the outlier. The point is that Scala, for instance, > has explicit support to hide the distinction between accessing a value > and computing a value. The point is to support the uniform access > principle. > > http://en.wikipedia.org/wiki/Uniform_access_principle > In

Re: [ANN] aprint (awesome print) released

2014-09-28 Thread Brandon Bloom
Forgive me if this is unwelcome self-promotion, but I figured I'd take this opportunity to point out some similar projects: My re-usable pretty-printing engine with a simple EDN printer: https://github.com/brandonbloom/fipp A colorizing EDN printer built on Fipp: https://github.com/greglook/puge

Re: Is Korma still a good current choice for DB backend?

2014-07-24 Thread Brandon Bloom
> > I think you mean (not date-range) and (not qualifier)? Otherwise you'll > have (true OR ...) if the params are present... But that's a very neat > trick! > Ah, yes, that's of course what I meant. Was wasting mental cycles on parameter ordering... Use named parameters people! > I ran it past

Re: Is Korma still a good current choice for DB backend?

2014-07-23 Thread Brandon Bloom
You could just add tests for extra params in OR clauses. For example, instead of: (str "SELECT ... main query stuff WHERE basic conditions" > (when date-range (str " AND dateUpdated >= ? AND dateUpdated < ?")) > (when qualifier " AND someColumn = ?")) > You do this: SELECT ... main query stuff

Re: unexpected behavior of clojure.core/empty

2014-07-19 Thread Brandon Bloom
It's worth mentioning that ClojureScript does not have a MapEntry type. Vectors implement IMapEntry using nth: https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L3601-L3605 And empty returns an empty vector: ClojureScript:cljs.user> (empty (first {:a 1})) [] On Satu

Re: unexpected behavior of clojure.core/empty

2014-07-19 Thread Brandon Bloom
You cannot have an empty MapEntry though, because map entries always have > just one size, a key and a value. I can definitely see how it can be > confusing though. > > > On Sat, Jul 19, 2014 at 4:42 PM, Brandon Bloom > wrote: > >> I've been bitten by all three of th

Re: unexpected behavior of clojure.core/empty

2014-07-19 Thread Brandon Bloom
I've been bitten by all three of these things in the past: 1) A MapEntry looks like a vector, but isn't. 2) Two element vectors can't be used as map entries. 3) Applying empty to a MapEntry returns nil. On Saturday, July 19, 2014 4:04:13 PM UTC-4, Jozef Wagner wrote: > > While the c.l.MapEntry is

Re: Mathematica like eval

2014-06-16 Thread Brandon Bloom
3, you're probably out of luck in the short term. Longer term, I indent to experiment with this stuff in the context of https://github.com/brandonbloom/eclj Cheers, Brandon On Monday, June 16, 2014 1:25:40 PM UTC-4, kovasb wrote: > > So I've thought about this quite a bit (as

Re: "recursive" hierarchies and derive

2014-05-13 Thread Brandon Bloom
Leif is right, but isa?'s docstring doesn't mention this behavior. Here's the relevant code: https://github.com/clojure/clojure/blob/028af0e0b271aa558ea44780e5d951f4932c7842/src/clj/clojure/core.clj#L5120 On Tuesday, May 13, 2014 12:22:28 AM UTC-4, Leif wrote: > > Hi, Ranko. > > I *think* it's

Re: ISeq documentation and mutual deftypes.

2014-02-11 Thread Brandon Bloom
> > The other question: is it possible to have two mutually refering deftype > definitions. > Although recursive types makes sense on the JVM, it doesn't necessarily make sense on hosts without an explicit type system in which to resolve the mutual recursion; consider ClojureScript. You don't

Re: concat/forth in ->, ->>

2014-01-19 Thread Brandon Bloom
It's worth noting that the -> and ->> macros are just that: macros. They have lexical extent and are expanded at compile time. Factjor is (essentially) interpreted, but can be used in interesting higher order ways. For example, you can write functions that return lazy sequences of Factjor instr

Re: obtain # of elements currently on a channel?

2014-01-11 Thread Brandon Bloom
Any API that lets you peek at the "state" of a channel is a surefire source of race conditions. So no, public API-wise, there isn't any way to do what you want. In theory, you can peek at the internals using reflection to get that information, but don't do that! Instead, you can simply *count*

Re: [ANN] data.avl 0.0.10 -- fast sorted maps and sets with log-time rank queries

2014-01-05 Thread Brandon Bloom
MichaƂ: This is awesome. Thanks for the continued awesome work on data structures! > ;; if the key is not present in the collection, -1 is returned: > (avl/rank-of (avl/sorted-set 3 4 5) 0) > ;= -1 > Curious: Why not return nil instead of -1? -- -- You received this message because

Re: (core.async/go nil) behavior?

2013-12-14 Thread Brandon Bloom
Sounds like a bug to me. A nil value in return position of a go block should probably close the channel. On Saturday, December 14, 2013 2:18:07 PM UTC-5, Stephen Cagle wrote: > > core.async discourages you from placing nil in a channel, as nil is only > taken when the channel has been closed. Ho

Re: Type of let form

2013-10-04 Thread Brandon Bloom
I agree, it's clear that this is intentional. The promised public API is the "let" form; "let*" is an implementation detail. Clojure and ClojureScript already have subtly different internal special symbols. For example: try vs try*. Unfortunately, this implementation detail leaks out in the mac

Re: Reading namespaced keywords

2013-09-17 Thread Brandon Bloom
> The double-colon is only shorthand for the current namespace: Or other namespaces via an alias: (alias 'clj 'clojure.core) ::clj/foo => :clojure.core/foo Inside ns forms, the :as keyword creates aliases. -- -- You received this message because you are subscribed to the Google Groups "Clojur

Re: ANN: ClojureScript 0.0-1877 (Breaking change)

2013-09-09 Thread Brandon Bloom
> a (very) temporary workaround is to use the old code Why not just switch (k coll) to (get coll k) ? If you know that coll is non-nil, you can also just use (coll k). Both forms also accept an optional not-found value. -- -- You received this message because you are subscribed to the Google

Re: [ANN] "Type Coverage" - core.typed 0.2.3, lein-typed 0.3.0

2013-09-04 Thread Brandon Bloom
> lein-typed 0.3.0 is also released, and supports a new coverage command. Awesome! > This is all part of Brandon Bloom's ideal vision of how types should be used in Clojure. Thanks for the great

Re: ClojureScript: Keyword Breaking Change Around the Corner

2013-08-28 Thread Brandon Bloom
> Will identical? correctly handle keywords under advanced compilation, with keywords constants emited? The missing part of your question is: "What about dynamically constructed keywords?" When the constant table provided by this patch is enabled, all keywords statically present in source code

Re: core.async - handling nils

2013-08-27 Thread Brandon Bloom
n the > state of the mouse button. Even saying that though, I would probably opt > for :clicked and :unclicked or somethig of that nature. > > Timothy > > > On Tue, Aug 27, 2013 at 9:15 AM, Brandon Bloom > wrote: > >> > In every use of channels I've had th

Re: core.async - handling nils

2013-08-27 Thread Brandon Bloom
> In every use of channels I've had thus far, nil is better expressed as an empty collection, false, 0, :tick, or some other "ground value". I agree completely. But I'll note that you mention false being useful... If you're writing completely general operators, like map, which are *sometimes* qui

Re: core.async - handling nils

2013-08-17 Thread Brandon Bloom
e that wrappers for nil values could also work, but that seems to > be a more complex solution (and also potentially with more overhead) than a > sentinel value > > > On Saturday, 17 August 2013 07:50:06 UTC+8, Brandon Bloom wrote: > >> I ran into the other half of this

Re: core.async - handling nils

2013-08-16 Thread Brandon Bloom
> have every other value come wrapped in a Just or Some-like constructor That's what I meant by "a pair of quote/unquote operators" -- -- 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

Re: core.async - handling nils

2013-08-16 Thread Brandon Bloom
I ran into the other half of this problem: If you expect nils to signify closed channels, then you can't leverage the logically false nature of nil without excluding explicit boolean false values. Given the pleasant syntax of if-let / > Hi all, > > I'm experimenting with core.async. Most of it

Re: core.async channel GUID

2013-08-07 Thread Brandon Bloom
You can emulate this relatively easily with a pair of serialize/deserialize functions which read/write to a global atom containing a map. On Wednesday, August 7, 2013 7:15:55 PM UTC-4, David Pollak wrote: > > Howdy, > > I'm working on bridging between core.async channels in the browser and on >

Re: subseq, garbage collection, and finalize

2013-07-29 Thread Brandon Bloom
Thanks Cedric & Patrick for the WeakReference and ReferenceQueue tips. Will try that next time. > There is an initial instance without metadata Oh! That makes a lot of sense. Thanks much for figuring that out and explaining it. We could probably optimize that second allocation away relatively eas

subseq, garbage collection, and finalize

2013-07-28 Thread Brandon Bloom
Hi all, I'm trying to understand the object retention behavior when subseq is applied to sorted collections. A quick glance at the source of APersistentTreeMap.java suggests that the reified subseq onl

Re: direction of an arrow in core.async

2013-07-14 Thread Brandon Bloom
> When I read code like (- 1 2), I tranform it into (1 - 2) in my head I used to do this when I was first learning a lisp, but now I read "+" as "sum" instead of "plus" and "-" as "subtract" instead of "minus". Similarly, if you see (< x y), you can say "x less than y", but what about (<= x y z

Re: [ANN]: Introducing lein-try

2013-07-13 Thread Brandon Bloom
;[clj-time' '"0.5.1"]' That seems to work, but it a bit awkward to use. On Sat, Jul 13, 2013 at 12:44 PM, Steven Degutis wrote: > It looks like you're not supposed to quote the arguments you pass it. > > > On Sat, Jul 13, 2013 at 11:27 AM, Brandon Blo

Re: [ANN]: Introducing lein-try

2013-07-13 Thread Brandon Bloom
This is awesome! I've totally wanted this. Unfortunately, I can't get it to work... ~ $ lein try '[clj-time "0.5.1"]' nREPL server started on port 61689 REPL-y 0.1.10 Clojure 1.5.1 Exit: Control+D or (exit) or (quit) Commands: (user/help) Docs: (doc function-name-here) (find-doc

Re: core.async: communicating termination

2013-07-12 Thread Brandon Bloom
>> You're only supposed to close a channel from the producer side. > Why? First, an appeal to authority: http://golang.org/pkg/builtin/#close Notice the type of the argument: chan<- That's a write-only port. Go's type system allows automatic coercion from read/write ports to constrained read or wr

Re: core.async: communicating termination

2013-07-12 Thread Brandon Bloom
> However, if what one is trying is to *stop* putting values on the channel, I see no possible race conditions. Querying the state of a channel at worst leads to race conditions and at best leads to bad design. You're only supposed to close a channel from the producer side. So if you're the on

Re: core.async: communicating termination

2013-07-11 Thread Brandon Bloom
Wouldn't closed and drained predicates introduce race conditions? (Sorry for brevity, on my phone) -- -- 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

Re: Microsoft Rx -style operations with core.async

2013-07-02 Thread Brandon Bloom
While it's fresh in my mind, some quick thoughts: (defn inc-all > "increments every int received in the input channel" > ([in] > (let [out (chan)] >(inc-all in out) >out)) > ([in out] > (go (while true >(>! out (inc ( A) The first overload and second overload for this

Re: Microsoft Rx -style operations with core.async

2013-07-02 Thread Brandon Bloom
> These look great! Thanks! > I would, however, avoid using go-as. [...snip...] Yeah, David Nolen mentioned that in IRC. I was thinking something along the lines of (go-as [c blah] ...) which would basically do (let [c (or blah (chan))] ...) Next time I get some extra cycles, I'll investigate w

Re: Microsoft Rx -style operations with core.async

2013-07-02 Thread Brandon Bloom
When I first wrote this code, I intentionally avoided any custom syntactical sugar and worked as closely with the primitives as I could. After a few days away, I've used fresh eyes to abstract and revamp. The new code is *dramatically* cleaner and I only needed to introduce a few simple and pre

Re: core.async - question about close!

2013-07-01 Thread Brandon Bloom
close! is a control signal from producer to consumers. It's how you say "Nothing else follows". It is not necessary for garbage collection. On Monday, July 1, 2013 2:43:02 AM UTC-4, puzzler wrote: > > Is close! merely a convenience function to ensure that future puts to a > channel will not be

Re: Microsoft Rx -style operations with core.async

2013-06-30 Thread Brandon Bloom
Then maybe we need (go-as [c arg] ...) On Sunday, June 30, 2013 8:15:45 PM UTC-4, David Nolen wrote: > > Because of blocking on read/write on unbuffered channels - users might > need more flexibility. > > > On Sun, Jun 30, 2013 at 8:13 PM, Brandon Bloom > > > wro

Re: Microsoft Rx -style operations with core.async

2013-06-30 Thread Brandon Bloom
> My understanding with some member of the core.async team is that most channel based APIs fns should *take* a channel and only construct one as a default. Could you elaborate on and motivate that? -- -- You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: Microsoft Rx -style operations with core.async

2013-06-30 Thread Brandon Bloom
annel, if, when, if-let, and when-let are extremely convenient. Unfortunately, they are subtly bugged! You need nil? checks everywhere, cluttering up relatively nice code. On Sun, Jun 30, 2013 at 5:27 PM, Brandon Bloom wrote: > Hi all, > > Today, primarily for my own edification, I'v

Re: Microsoft Rx -style operations with core.async

2013-06-30 Thread Brandon Bloom
> I don't know the semantics of the MS functions so maybe this mirrors them This code is not an attempt to replicate the semantics of Rx, just provide a comparable set of operators. > the implementations of take-while and drop-while remove an "extra" element from the argument channel, right? Yes

Microsoft Rx -style operations with core.async

2013-06-30 Thread Brandon Bloom
Hi all, Today, primarily for my own edification, I've been implementing as many Microsoft Reactive Extensions operators as I can using core.async. The results have been *spectacular*. core.async is an absolute pleasure to work with. I'm so happy with how they have turned out, that I really want

Re: Is there a better way to update a map atom?

2013-06-29 Thread Brandon Bloom
Could we please curb the pedantry? On Sat, Jun 29, 2013 at 9:21 PM, Ben Wolfson wrote: > On Sat, Jun 29, 2013 at 6:06 PM, Cedric Greevey wrote: > >> Who said swap *was* CAS, rather than was implemented *in terms of* CAS? >> In any event, your claim that "no comparison is done unless it's done in

Re: Is there a better way to update a map atom?

2013-06-29 Thread Brandon Bloom
> Can anyone explain the relationship between swap! and reset! ? swap! is for "CAS" See: http://en.wikipedia.org/wiki/Compare-and-swap In the examples here, you're fully replacing a value, so reset! is fine... assuming that the replacement value was not derived from the existing value. If the

Re: core.async

2013-06-29 Thread Brandon Bloom
I don't think it's published to a maven repository yet. You can check it out, install it with `lein install`, then depend on it via [core.async "0.1.0-SNAPSHOT"] On Sat, Jun 29, 2013 at 2:50 PM, David Pollak wrote: > What's the entry in project.clj to use the core.async stuff? > > Thanks! > > >

Re: core.async

2013-06-28 Thread Brandon Bloom
> CSP proper is amenable to certain kinds of automated correctness analysis. > No work has been done on that front for core.async as yet. Although a far cry from Go's race detector, Go did ship with one feature that is helpful for preventing a certain class

Re: core.async

2013-06-28 Thread Brandon Bloom
> Are people in love with names like `!!`, or is there room for rethinking the naming? These operators are important and common enough to justify being *syntax* in Go, which is pretty minimal on syntax overall. Personally, I think the names are pretty good. -- -- You received this message be

Re: ANN: ClojureScript release 0.0-1798

2013-06-25 Thread Brandon Bloom
Even if it's horribly broken, maybe we should default it to on for advanced builds anyway? It's not like anything can be harder to debug than raw advanced compilation output. Besides, we might get some more interest and contributions if it *feels* like it's close! On Tuesday, June 25, 2013 7:37

Re: representing clojure source code as data?

2013-06-23 Thread Brandon Bloom
> By "raw data structures", you mean the concrete implementing classes, a la clojure.lang.PersistentVector? Yes. "(quote 1)" -> > {:head :list :body [quote 1]} > You're not going far enough with this. Here's how my code is representing that: {:composite :list, :items [{:value quote} {:value 1}

Re: representing clojure source code as data?

2013-06-21 Thread Brandon Bloom
> I think there are 2 representations that could be useful: I think there are really two axis: 1) Shape of the data and 2) Language being described You've outlined 2 out of the 3 interesting (to me) shapes: 1) raw data structures and 2) datoms. I think that the 3rd interesting one is a map/vec

Re: generating core.logic queries

2013-06-21 Thread Brandon Bloom
> Perhaps not, but apparently the developers of core.logic are. That's kinda a funny remark to make to David Nolen, who is *the* developer of core.logic. In this case, he's talking about this wiki page: https://github.com/clojure/core.logic/wiki/Extending-core.logic-(Datomic-example) That's no

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-11 Thread Brandon Bloom
> Maybe it makes sense to separate out the 'common testing interop' effort > from the 'another test framework' effort, so it can can get off the ground? I agree with this. It's easier to solve fewer problems at once. Maybe you should reduce the scope to just the common result reporting schema? At

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-10 Thread Brandon Bloom
There are currently 4 roles defined: Definer, Asserter, Runner, and Reporter. It looks like the "Runner" does finding, filtering, and execution. I think you could further break the Runner down into Discoverer and Executor. I might want to just ask "What tests do I have?" without actually runnin

Re: Why the CLR languages fail?

2013-06-06 Thread Brandon Bloom
Alexandru's analysis is spot on. Here's the pithy IRC version I've used in the past: "C# has a better type system and compiler, so it doesn't need as good of a JIT. That's a problem for languages that aren't C#, especially dynamic ones." There are lots of caveats, but that more or less covers i

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 Brandon Bloom
Coming from Visual Studio all those years ago, I deeply missed my debugger. These days, I miss my debugger extremely rarely. And when I do use a debugger, I much prefer a non-visual one: Either something like dgb, or something like a hypothetical open-repl-here function, where I can ask specifi

Re: defmethod/require race condition

2013-05-09 Thread Brandon Bloom
This is an unfortunate ugly side effect of def and def-like forms being, um, side effectual. In the particular case of defmethod, I think that the general recommendation would be to structure your namespaces such that methods are defined along side the code that could produce dispatch values wh

Re: invokedynamic instructions in Clojure

2013-04-16 Thread Brandon Bloom
Do you have any measurements, results, or conclusions to report? On Tuesday, April 16, 2013 12:12:15 PM UTC-4, Ghadi Shayban wrote: > > I've added a very minimal usage of invokedynamic to the compiler. > Basically the smallest delta without having to change internals of ObjExpr > or break ABI c

Re: [ANN] Instaparse 1.0.0

2013-04-14 Thread Brandon Bloom
Thanks for the details. You definitely made the right pragmatic decision. What you've said pretty much matches what I expected to hear, although I'm hopeful that the approach can be refined, since it's quite eloquent. Beyond eloquence, the derivatives approach is also interesting for schema val

Re: [ANN] Instaparse 1.0.0

2013-04-12 Thread Brandon Bloom
Super cool! Nice work. Your readme says "I had difficulty getting his Parsing with Derivatives technique to work in a performant way". I was wondering if you could please elaborate. What kind of performance did you achieve? How does that compare to the GLL parser you implemented? Did you imple

Re: What's the point of -> ?

2013-03-12 Thread Brandon Bloom
One other thing to consider is partial application. The collection functions tend to put the most-likely-to-be-curried arguments first. For example: (def sum (partial reduce + 0)) Compare to coll-reduce, which dispatches on the type of the first argument: (require '[clojure.core.protocols :ref

*clojure-version* and "feature" data

2013-03-06 Thread Brandon Bloom
Hi all, In the interest of Clojure & ClojureScript interop, I'd like to break down the discussion for dev.clojure.org/display/design/Feature+Expressions into two parts: 1) The potential syntax changes or core macro additions and 2) the underlying data source that would allow for conditional com

Re: features expression

2013-03-06 Thread Brandon Bloom
> I believe protocols can entirely alleviate the need for feature expressions. How do you figure that? One major incompatibility between Clojure and ClojureScript currently is that the protocols don't match up. If you want a deftype form that is 90% the same, but has a conditional switch for a

Re: [ClojureScript] features expression

2013-03-05 Thread Brandon Bloom
> I personally think the CL feature expression approach is satisfactory. The more I think about it, the less I think that the CL Feature Expression approach is satisfactory as is. I'm now reasonably convinced that, horror of horrors, we should look to the C preprocessor for inspiration. CL's a

Re: help make a macro that takes an input and will evaluate only the unquoted parts

2013-02-19 Thread Brandon Bloom
Shameless self-promotion: https://github.com/brandonbloom/backtick On Tuesday, February 19, 2013 1:35:28 PM UTC-5, AtKaaZ wrote: > > I am trying (but failing) to find a way to have a macro like: > => *(xmacro* {:a (+ 1 2) :b ~(+ 1 3)}) > {:a (clojure.core/+ 1 2), :b 4} > ;*without specifying the b

Re: "IF"?

2013-02-12 Thread Brandon Bloom
Clojure, like most Lisps, has a top-to-bottom, inside-out, left-to-right, eager evaluation strategy. All Clojure forms are expressions, and thus must return a value. Given these two design requirements, (if test then else) is the natural branching primitive. It implies serialize execution (top-

Re: Call for volunteers to help moderate a ClojureScript Google group

2013-01-23 Thread Brandon Bloom
/me steps forward On Wednesday, January 23, 2013 10:53:34 AM UTC-8, Andy Fingerhut wrote: > > An interest was expressed by a few in having a separate ClojureScript > mailing list. > > If it is a Google group, that requires moderating messages sent to the > group, via manual approval. I suspect

Re: Is contributing to clojurescript is intentionally made hard ?

2013-01-20 Thread Brandon Bloom
I think the inflammatory thread subject didn't help... Java and cross-browser CI both sound great. I don't know if Clojure/core already has CI or what, but maybe you should take these ideas over to another thread? Possibly on the Dev mailing list. Because of the intentionally slow pace of Cloju

Re: Is contributing to clojurescript is intentionally made hard ?

2013-01-20 Thread Brandon Bloom
There are 176 forks on GitHub. Even assuming that all 51 contributors have a public fork (most probably do), that's 125 potential contributors unaccounted for. Only 29% of those forks account for an accepted contribution. What portion of the remainder might have been contributors? I was curious

Re: Is contributing to clojurescript is intentionally made hard ?

2013-01-19 Thread Brandon Bloom
Aaron, please forgive my failure at formalities: Allow me to add that I agree with the rest of your post. The Linux kernel and Guava guys are absolutely right about patches defaulting to the rejected state. I'm a big believer in the "minus 100 points" philosophy. It's just that I just really h

Re: Is contributing to clojurescript is intentionally made hard ?

2013-01-19 Thread Brandon Bloom
> contributions to clojure are definitely less easy to make than to projects > that willy-nilly accept any pull request. False dichotomy. Accepting pull requests does not mean you need to be willy-nilly about it. You know how people carefully optimize their signup forms and checkout flows? They

Re: Is contributing to clojurescript is intentionally made hard ?

2013-01-19 Thread Brandon Bloom
For what it's worth, I've submitted 20+ patches to ClojureScript and one or two to Clojure proper. I still find the process to be extremely unpleasant. I consistently avoid interacting with JIRA until the last possible minute: That software is actively user-hostile. Without naming names, I've sp

Re: Better ways of documenting functions with type information?

2013-01-13 Thread Brandon Bloom
You could use type hints and pre/post conditions: (defn foo "Gets adjusted pixels or whatever" [^BufferedImage screen ^Number x ^Number y] {:post [(foo-map? %)]} ...) (defn foo-map? "True if x is a map of maps with pixel colors ..." [x] ...) That said, it would be nice if clojure.r

Re: ANN: fipp - Fast Idiomatic Pretty-Printer

2013-01-12 Thread Brandon Bloom
Done: https://github.com/brandonbloom/fipp/commit/e7ae2cce42b9f0baf0f8e242b669fc19aad57ed3 Thanks! On Saturday, January 12, 2013 4:23:41 AM UTC-8, Michael Klishin wrote: > > Brandon, > > Please provide dependency information in the README, otherwise Clojure > beginners won't be able to use your

ANN: fipp - Fast Idiomatic Pretty-Printer

2013-01-11 Thread Brandon Bloom
Hi all, I decided to create a new pretty printer in the spirit of "Data All The Things!" And it's fast too! Fipp, the Fast Idiomatic Pretty-Printer for Clojure, is a pretty printer with linear runtime and bounded space requirements. Unlike clojure.pprint's side-effectual API, Fipp is configure

Re: "core.matrix" proposal

2013-01-08 Thread Brandon Bloom
There's a bunch of useful operations that games & animation systems perform frequently that are less common in other uses of linear algebra. For example: linear and spline interpolations. The DirectXMath library is worth studying: http://msdn.microsoft.com/en-us/library/windows/desktop/hh43783

Re: What's the current status of Clojure-in-Clojure?

2013-01-08 Thread Brandon Bloom
ClojureScript has the best chance of forming a base of Clojure-in-Clojure. I believe David Nolen would consider any patches that help decouple us from JavaScript. On Tuesday, January 8, 2013 3:44:16 PM UTC-8, Thor wrote: > > I think this would be a fun project to contribute to, but a few searche

Re: symbolic protocols

2013-01-08 Thread Brandon Bloom
> > The defmulti would be closer to > > (defmulti mm first) > > because we need to dig into the list to get the first symbol. > I don't think that there is anything stopping you from creating such a code walker now. Maybe you should built a proof of concept to demonstrate some use cases con

Re: Clojure 1.5.0 RC 1

2013-01-01 Thread Brandon Bloom
> Please test it. I just tried it out and was really bummed to discover that http://dev.clojure.org/jira/browse/CLJ-873 was not merged. That's the clojure.core// division symbol issue. It's a pretty straightforward patch that fixes a real problem for ClojureScript and a few other random librar

Re: What would you use a #[] data literal for?

2012-12-31 Thread Brandon Bloom
> Significant performance gain is achieved when destructuring by skipping nth and directly calling type fields instead. Have you also patched the destructuring mechanism? > Concrete vector implementation is not known when destructuring, so I'm left with a custom reader literal. How does the re

Re: What would you use a #[] data literal for?

2012-12-30 Thread Brandon Bloom
Wouldn't it be better to implement this as an automatic optimization, just like PersistentArrayMap vs PersistentHashMap ? fwiw, I'm cautiously in favor of #[] being used for queues. On Sunday, December 30, 2012 3:45:24 AM UTC-8, Jozef Wagner wrote: > > I use it in Clojurescript for a custom tupl

Re: I'm curious if the development of native Clojurescript macros is in progress

2012-12-28 Thread Brandon Bloom
> So I'm curious if the adoption of native macros into Clojurescript is in progress by contributors. The only visibile progress I know of here is Kanaka's self hosting fork: https://github.com/kanaka/clojurescript If not, is it on the plan at least? Or is it rejected after some discussion? > T

Re: Clojure raytracing scene description language

2012-12-09 Thread Brandon Bloom
Are you only interested in static scenes? Or are you interested in simulations too? On Sunday, December 9, 2012 4:03:36 PM UTC-8, Mikera wrote: > > Hi all, > > I'm working on a hobby project to implement a Clojure raytracer, something > along the lines of POV-Ray: > https://github.com/mikera/enl

Re: ANN: clj-schema, Schemas For Clojure Maps

2012-12-09 Thread Brandon Bloom
I wanted something like this to create an AST validator for ClojureScript! Will have to find some time to study your approach. On Sunday, November 25, 2012 3:22:04 PM UTC-8, Alex Baranosky wrote: > > Clj-schema is a library for defining and validating schemas for maps, as > well as for using tho

Re: Can anyone point me to that library that supports quasiquoting without full namespace expansion?

2012-12-02 Thread Brandon Bloom
I just published a new 0.2.0-SNAPSHOT that includes a fix parallel to Rich Hickey's change to handling of records in Clojure 1.5. On Sunday, December 2, 2012 10:27:46 AM UTC-8, Conrad wrote: > > Never mind, I just found it on clojars. It is: > https://github.com/brandonbloom/backtick > > On Sund

Re: Can CLJS functions have metadata?

2012-11-21 Thread Brandon Bloom
Fixed: http://dev.clojure.org/jira/browse/CLJS-359 On Saturday, August 25, 2012 12:49:47 AM UTC-7, Shantanu Kumar wrote: > > Hi, > > I noticed that `with-meta` is not working on function objects in CLJS. > Compilation fails with the following error: > > Error: No protocol method IWithMeta.-with-m

  1   2   >