Re: foo.spec?

2017-04-22 Thread Jamie English
a little slim at the moment, and probably make little sense without prior exposure to clojure.spec. I plan to address this before sharing it with the larger Ruby community. Jamie On 22 January 2017 at 06:38, Xiyang Chen wrote: > Hi, > > In addition to js.spec, here is another alter

Re: foo.spec?

2017-01-02 Thread Jamie English
On Thursday, 29 December 2016 19:14:49 UTC-8, Rich Morin wrote: > > On Thursday, December 29, 2016 at 6:24:39 PM UTC-8, Jamie English wrote: >> >> I've spent some time over the holidays working on a Ruby port of >> clojure.spec: ... >> > > I'm delight

Re: foo.spec?

2016-12-29 Thread Jamie English
th clojure.spec within the next couple of months. Cheers, Jamie On Thursday, 29 December 2016 18:17:47 UTC, Rich Morin wrote: > > Does anyone know of efforts to port clojure.spec to other languages? I > thought I had seen someone mention versions for Haskell and Scala, but I > ca

Re: [ClojureScript] Re: [reagent] Re: [ANN] SF Reagent Meetup TODAY 6:30pm @Loyal3 @Meerkat

2015-04-17 Thread Jamie Orchard-Hays
Excellent. I tried to watch on periscope, but it never showed up. Jamie On Apr 17, 2015, at 10:20 AM, Marc Fawzi wrote: > yes, will post link here sometime next week > > all 3 presentations were screen captured too so it will be very easy to > follow > > Sent from my iPho

Re: [ClojureScript] A question for TDD practitioners

2014-01-29 Thread Jamie Orchard-Hays
Wow. Props for the Modern Times reference! On Jan 29, 2014, at 4:50 PM, Mimmo Cosenza wrote: > Thanks Sean. > Ok. I'll update the various lein templates in accordance with this choice. > > Unfortunately we still have to wait for cljsbuild to be extended to support > the auto mode for test

Re: [ClojureScript] ANN: Om 0.3.0

2014-01-27 Thread Jamie Orchard-Hays
omponents, > we're finally getting to the "good stuff" IMO :) > > David > > > On Sun, Jan 26, 2014 at 9:59 PM, Jamie Orchard-Hays > wrote: > :) Worked through the Om tutorial today. Thanks much, David. Good stuff. > > On Jan 26, 2014, at 8:54

Re: New release of Light Table (which is now open source!)

2014-01-08 Thread Jamie Brandon
You can disable the bracket insertion by disabling the keys that trigger it. Add this to your user.keymap: :- {:editor.keys.normal {"\"" [(:editor.repeat-pair "\"")] "(" [(:editor.open-pair "(")] ")" [(:editor.close-pair ")")]

Re: Moseley's FRP

2013-12-09 Thread Jamie Brandon
a normalised view over a denormalised database. On 10 December 2013 01:57, Jamie Brandon wrote: > That part that seemed relevant to your question is compile queries on > denormalised views to queries on normalised databases. > > > On 9 December 2013 22:07, Brian Craft w

Re: Moseley's FRP

2013-12-09 Thread Jamie Brandon
to sql queries against a db. It > doesn't, for example, address indexing in-memory data. > > > On Monday, December 9, 2013 11:23:36 AM UTC-8, Jamie Brandon wrote: > >> Take a look at "A practical theory of language-integrated query" at >> http://homepages

Re: Moseley's FRP

2013-12-09 Thread Jamie Brandon
Take a look at "A practical theory of language-integrated query" at http://homepages.inf.ed.ac.uk/wadler/topics/recent.html . In the FPDays talk linked there Wadler demonstrated writing queries which returned denormalised views on tables, composing those with queries on the denormalised view and co

[ANN] strucjure 0.4.0

2013-12-09 Thread Jamie Brandon
Better late than never :) https://github.com/jamii/strucjure Strucjure is a library for describing stuff in an executable manner. It gives you pattern matching (with first-class patterns), validators, parsers, walks and lenses (and eventually generators). The shape of your data is immediately app

Re: Access the datastructure used to create a function?

2013-11-26 Thread Jamie Brandon
ot sure. On 26 November 2013 17:11, Guru Devanla wrote: > Hi Jamie, > > Thats interesting. How do I not let the compiler not optimize away the fact > that y refers to the constant. When I run your program I have two constant > fields defined rather than 'y. Am I missing something.

Re: Access the datastructure used to create a function?

2013-11-26 Thread Jamie Brandon
> (def f (let [y 1] (fn [x] (+ x y Let's have a look inside. > (require '[no.disassemble :refer [disassemble]]) > (println (disassemble f)) // Compiled from /home/jamie/strucjure/src/strucjure.clj (version 1.5 : 49.0, super bit) public final class strucjure$fn__55

Hitting the PermGen bugs (CLJ-1152) with core.logic

2013-10-18 Thread Jamie
gation code that -- under some currently unknown load threshold -- lets us at least get some more testing done. https://gist.github.com/jsmorph/7042092 The excellent CLJ-1152 bug report (nice work!) suggests this approach. Definitely not a work-around. Just some mitigation. --Jamie --

Re: print-dup is not defined? Ok, what do you want me to do about that?

2013-09-20 Thread Jamie Brandon
JVM bytecode can't contain data-structures, only code. If you eval something or embed it in macro output the clojure compiler needs to be able to output code that reconstructs an equal object. There are some types that it can't do that for. user=> (def x) #'user/x user=> x # user=> (eval x) # user

Re: Hotspot predictability

2013-09-18 Thread Jamie Brandon
reful with > doseq benchmarks like this though, if you aren't careful hotspot can > completely eliminate parts of the computation as dead code if it can infer > the results aren't used. Criterion has a neat trick for making sure this > can't happen, IIRC. > > > O

Re: Hotspot predictability

2013-09-17 Thread Jamie Brandon
For larger patterns, the staged version is actually significantly faster: https://gist.github.com/jamii/6597235 On 17 September 2013 16:29, Jamie Brandon wrote: > I ran a little benchmark comparing different implementations of a toy > pattern matching protocol: > > https://gist.gith

Hotspot predictability

2013-09-17 Thread Jamie Brandon
I ran a little benchmark comparing different implementations of a toy pattern matching protocol: https://gist.github.com/jamii/6595850 I'm surprised to find that the staged version is not significantly slower than the compiled version. Now I'm wondering whether this is feasible on a larger scale.

Re: wally: a alternative way to discover functions

2013-09-07 Thread Jamie Brandon
I wonder if you can do something clever with class-loaders to prevent side-effects when testing functions... On 7 September 2013 20:16, Islon Scherer wrote: >> I wonder if it would be possible to improve it using the core.typed >> library and doing some kind of static analysis similar to Haskell'

Re: eval/macros with functions with metadata

2013-08-29 Thread Jamie Brandon
which Hotspot > seems to be able to optimize just fine): > > (let [y 1 f (fn [x] (+ x y))] ((eval `(fn [g#] (g# 1))) f)) > > Happy to elaborate if you like. > > Cheers, > Jason > > [1] http://dev.clojure.org/jira/browse/CLJ-1206 > > > On Wednesday, August 28, 2013 10:59:

Re: eval/macros with functions with metadata

2013-08-28 Thread Jamie Brandon
-in are doing. > > If the letfn is being generated by your compilation step, why can't that go > inside of your generated fn rather than outside it? > > (clojure.core/fn > [input__2288__auto__] > (clojure.core/letfn > [(num ...) > (succ ...) &

Re: eval/macros with functions with metadata

2013-08-28 Thread Jamie Brandon
; repeat until you get bored >> ) >> >> (defn e [f] >> (let [wr (Wrapper. f)] >> (eval `(~wr 1)))) >> >> (e inc) >> >> (e (with-meta (fn [x] (+ 4 x)) {})) >> >> >> >> On Wed, Aug 28, 2013 at 1:59 PM, Jamie Brandon >>

Re: Eval vs the repl

2013-08-28 Thread Jamie Brandon
> Just curious: what do you expect that to do? It was actually the second example that was causing me trouble and when I was digging through the compiler for the cause I noticed the first. I don't actually want to write that code, I'm just confused as to why nrepl.el gives a different answer to le

Re: eval/macros with functions with metadata

2013-08-28 Thread Jamie Brandon
nsider this hacky or not. > > (def ^:dynamic *fn-helper*) > > (defn eval-at-one [f] (binding [*fn-helper* f] (eval '(*fn-helper* 1 > > > On Wed, Aug 28, 2013 at 1:28 PM, Jamie Brandon > wrote: >> >> You will also run into problems if your functions close ov

Re: eval/macros with functions with metadata

2013-08-28 Thread Jamie Brandon
(fn [] (do-stuff-with @~f))) {::strong-ref f})) So that way f will be freed up when the resulting fn is gced. On 28 August 2013 17:59, Ben Wolfson wrote: > On Wed, Aug 28, 2013 at 9:27 AM, Jamie Brandon > wrote: >> >> >> If you aren't worried about leaking memory, a

Re: Eval vs the repl

2013-08-28 Thread Jamie Brandon
Huh, I'm using nrepl.el but if I use lein repl I get the same results as you. On 28 August 2013 18:16, Aaron Cohen wrote: > What repl are you using? I think it's doing something weird. > > java -cp clojure-1.5.1.jar clojure.main > user=> [do (inc 1)] > 2 > user> ^{:line 11, :column 20} [] > Class

Re: eval/macros with functions with metadata

2013-08-28 Thread Jamie Brandon
Clojure struggles with staged programming because of JVM limitations. "The deeper issue here is that JVM bytecode is fundamentally static: it's not allowed to contain references to objects that only exist at runtime. In languages that have a built-in concept of a "runtime image," like Smalltalk o

Eval vs the repl

2013-08-28 Thread Jamie Brandon
I had previously assumed that the clojure repl effectively just did (eval (read-string input)). That doesn't seem to be the case eg: user> [do (inc 1)] CompilerException java.lang.RuntimeException: Unable to resolve symbol: do in this context, compiling:(NO_SOURCE_PATH:1:1) user> (eval '[do (inc 1

Re: Confused by var eval behaviour

2013-08-09 Thread Jamie Brandon
d? > Regular code forms (as returned by the reader) don't usually contain > functions. When the compiler doesn't know how to evaluate some value it > treats it as a constant. Constants are serialized in the class and read > back/instanciated when the class is loaded. > &g

Re: Confused by var eval behaviour

2013-08-08 Thread Jamie Brandon
gen.invokeStatic(RT_TYPE, Method.getMethod("clojure.lang.Var > var(String,String)")); > } > > Christophe > > > > On Thu, Aug 8, 2013 at 4:44 PM, Jamie Brandon > wrote: >> >> What if it isn't inside a constant? >> &

Re: Confused by var eval behaviour

2013-08-08 Thread Jamie Brandon
quot;foo")]) CompilerException java.lang.RuntimeException: Can't embed object in code, maybe print-dup not defined: java.io.StringReader@7504a5ce, compiling:(NO_SOURCE_PATH:1:1) So I guess Fn and Var have print-dup methods defined. I still don't understand why print-dup is used at all though. On 8 August 2

Re: Confused by var eval behaviour

2013-08-08 Thread Jamie Brandon
lize the constant. > # is unreadable while #'user/x is that explains teh > difference in behaviour. > > > On Thu, Aug 8, 2013 at 3:40 PM, Jamie Brandon > wrote: >> >> This has me stumped: >> >> user=> (with-local-vars [x nil] (eval x)) >> # >

Confused by var eval behaviour

2013-08-08 Thread Jamie Brandon
This has me stumped: user=> (with-local-vars [x nil] (eval x)) # user=> (with-local-vars [x nil] (eval [x])) CompilerException java.lang.NullPointerException, compiling:(NO_SOURCE_PATH:1:1) By comparison: user=> (def x nil) #'user/x user=> (eval #'x) #'user/x user=> (eval [#'x]) [#'user/x] --

Re: [ANN] lein-gnome 0.1.0

2013-06-24 Thread Jamie Brandon
(I fell afoul of the new gmail compose window) Useful tools for writing gnome extensions in cljs: https://github.com/jamii/lein-gnome As a side effect, allows injecting a cljs repl into gnome-shell. On 24 June 2013 23:02, Jamie Brandon wrote: > Useful tools for writing gnome extensions

[ANN] lein-gnome 0.1.0

2013-06-24 Thread Jamie Brandon
Useful tools for writing gnome extensions in cljs: -- -- 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

Fair conjunction and parallel solvers in core.logic

2012-12-19 Thread Jamie Brandon
Last week I figured out how to add fair conjunction and a parallel solver (via fork-join) to core.logic. I just wrote up an explanation of how it works which may be interesting: http://scattered-thoughts.net/blog/2012/12/19/search-trees-and-core-dot-logic/ https://github.com/jamii/core.logic/tree

Re: way to test if a coll is a record?

2012-12-13 Thread Jamie Brandon
A2. (instance? clojure.lang.IRecord (Foo.)) On 12 December 2012 14:53, Andy Fingerhut wrote: > I haven't dug into the details, but this Clojure ticket looks like it might > be related, if not the same issue: > > http://dev.clojure.org/jira/browse/CLJ-1105 > > It has been vetted by Stuart Hallowa

ANN concerto 0.1.0-SNAPSHOT

2012-11-13 Thread Jamie Brandon
Concerto extends nrepl (and nrepl.el) with a broadcast mechanism so that multiple users can colloborate within a single repl. Just an experiment, I'm curious to see whether anyone has a use for this. My eventual goal is to use it for collaborative ovetone sessions but for now I have to get back to

Re: core.logic for constraint logic programming

2012-10-24 Thread Jamie Brandon
Ok, clearly I've not been keeping up, sorry :) On 24 October 2012 18:17, David Nolen wrote: > On Wed, Oct 24, 2012 at 6:07 PM, Jamie Brandon > wrote: >> >> It sounds like something that would benefit from good constraint >> propagation. If I remember corre

Re: core.logic for constraint logic programming

2012-10-24 Thread Jamie Brandon
It sounds like something that would benefit from good constraint propagation. If I remember correctly, core.logic only support propagating equality/inequality constraints which can be pretty slow for exploring large domains. Something like gecode (http://www.gecode.org) might be a better fit if you

Re: ANN strucjure 0.1.0

2012-10-12 Thread Jamie Brandon
> Compared to core.logic Oops, that should be core.match. -- 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

ANN strucjure 0.1.0

2012-10-12 Thread Jamie Brandon
can express eg context-free grammars. I still have lot of work to do to make this production-ready but I wanted to get some feedback before I start comitting to the current design. Jamie -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: Core.logic interface to Lucene in 10 lines

2012-07-06 Thread Jamie
", :value "1.53"} ;; {:target "1.61", :date "2012-06-05", :value "1.57"} ;; {:target "1.61", :date "2012-06-11", :value "1.60"} ;; {:target "1.61", :date "2012-06-15", :value "1.60"} ;; {:tar

Re: Core.logic interface to Lucene in 10 lines

2012-07-06 Thread Jamie
s that use them together. Hopefully soon. Thanks for all of your work here. --Jamie -- 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 - pl

Core.logic interface to Lucene in 10 lines

2012-07-06 Thread Jamie
q] "A clojure.core.logic relation backed by Lucene. Lucene query generated by lucene-query based on the given map." (fn [a] (logic/to-stream (map #(logic/unify a % q) (lucene-query q a) --Jamie -- You received this message because you are subscribed to the Goo

Troubles with truthiness

2012-05-14 Thread Jamie Brandon
I ran across this behaviour today: shackles.examples=> (import '[clojure.lang Seqable]) clojure.lang.Seqable shackles.examples=> (deftype Foo [] Seqable (seq [this] ())) shackles.examples.Foo shackles.examples=> (empty? (Foo.)) false shackles.examples=> (deftype Bar [] Seqable (seq [this] nil)) sh

Crowdfunding an open-source clojure library for p2p NAT traversal, dynamic addressing and pubsub

2012-02-26 Thread Jamie Brandon
n the initial proposal - https://gist.github.com/1910754 Cheers Jamie -- 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 pa

Clojure with Uncle Bob

2010-09-24 Thread Jamie
many people out there using Clojure for HPC? Jamie. -- 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

Re: ANN: Clojuratica v2 -- Seamless Mathematica-within-Clojure!

2009-12-01 Thread Jamie
matica/platforms/ Player runs on Linux and Mac OS X but not Solaris: http://www.wolfram.com/solutions/interactivedeployment/compare.html We use Mathematica primarily to generate production graphics. --Jamie -- You received this message because you are subscribed to the Google Groups &q

Re: roll call of production use?

2009-12-01 Thread Jamie
rising to me just how solid this innovative platform is. Outstanding work. Thanks again to Rich and the other contributors. --Jamie -- 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

Observations from a real-world Clojure project

2009-10-29 Thread Jamie
Matlab or R, and we don't need to. That's it for now. We'll look for ways we can contribute. Thanks again for the excellent system. --Jamie --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Re: Clojure Poll 09/2008

2008-09-10 Thread Jamie Brandon
> 1. Not a good way to READ from a string, (read (PushbackReader. (StringReader. my-string))) > I've noticed functions can only refer to those previously defined, so you > couldnt have 2 that depend on one another This is because symbols are looked up at compile time. So what you can do is (d