[ANN] Typed Clojure 1.1.1 - Symbolic Execution

2023-08-16 Thread Ambrose Bonnaire-Sergeant
Hi, I'm excited to announce Typed Clojure 1.1.1 which includes support for symbolic execution via a new type called a "symbolic closure". I have written a guide on how to think about this new type and what it enables. In short, it can dramatically decrease the number of local annotations needed

Re: [ANN] Clojure 1.10 has been released!

2018-12-18 Thread Ambrose Bonnaire-Sergeant
Thanks to everyone who designed, implemented, and tested this release! On Tuesday, December 18, 2018 at 5:33:07 AM UTC-5, Rick Moynihan wrote: > > Great news, > > Thanks to everyone who made this possible! > > R. > > On Tue, 18 Dec 2018 at 09:02, Thomas > > wrote: > >> Thank you for this release

Re: ANN: Parallel let macro!

2017-11-29 Thread Ambrose Bonnaire-Sergeant
Cool! Check out code-walking libraries like riddley or tools.analyzer.jvm to properly support special forms and variable shadowing. I had a quick crack myself but gave up when I remembered how hard this problem

Re: [ANN] Automatically generate your specs and types

2017-10-13 Thread Ambrose Bonnaire-Sergeant
as t in hello.core > generate-tenv: 1 infer-results > finished squash-horizonally > Start follow-all > end follow-all > start remove unreachable aliases > end remove unreachable aliases > done populating > Output annotations to #object[java.net.URL 0x738a39cc > file:/tm

Re: [ANN] Automatically generate your specs and types

2017-10-13 Thread Ambrose Bonnaire-Sergeant
ingshot/commit/df20eadb17abc6677f721763c5f5059a46693517#diff-9bd43a8aebd660e08a7c41cd0f0a13d0R74> Thanks, Ambrose On Friday, October 13, 2017 at 5:46:36 PM UTC-4, Ambrose Bonnaire-Sergeant wrote: > > This > <https://github.com/clojure/core.typed/blob/0552a59708bc20d26b2875776ab9cf09bbf62075/

Re: [ANN] Automatically generate your specs and types

2017-10-13 Thread Ambrose Bonnaire-Sergeant
ector. Also, [& body] arguments are common. On Friday, October 13, 2017 at 5:44:07 PM UTC-4, Ambrose Bonnaire-Sergeant wrote: > > Potentially. Actually, it currently instruments and gathers data about > macros, but doesn't > <https:/

Re: [ANN] Automatically generate your specs and types

2017-10-13 Thread Ambrose Bonnaire-Sergeant
troublesome, I haven't tried outputting any spec regex ops). Thanks, Ambrose On Friday, October 13, 2017 at 3:54:22 PM UTC-4, Colin Fleming wrote: > > This looks great! Can this be used to infer macro specs based on examples > of usage? > > On 14 October 2017 at 04:30, Ambrose B

[ANN] Automatically generate your specs and types

2017-10-13 Thread Ambrose Bonnaire-Sergeant
Hi, Happy to announce a new set of tools to *automatically* *generate* types and specs for your projects. *Dependency information:* 1. core.typed [org.clojure/core.typed "0.4.2"] 2. lein-typed [lein-typed

Re: [ANN] An exploration of Hash Array Mapped Tries

2016-12-06 Thread Ambrose Bonnaire-Sergeant
Link: https://github.com/frenchy64/optimized-kw-maps On Tue, Dec 6, 2016 at 4:16 PM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Hi, > > I've been having a ton of fun this semester learning about > Hash Array Mapped Tries (like PersistentHashMa

[ANN] An exploration of Hash Array Mapped Tries

2016-12-06 Thread Ambrose Bonnaire-Sergeant
Hi, I've been having a ton of fun this semester learning about Hash Array Mapped Tries (like PersistentHashMap). Link I have written a visual tutorial for HAMT's, as well as a reference implementation in Clojure that supports trie visualisations with Rhizome. There's also a little prototype+wri

Re: [ANN] Clojure 1.9.0-alpha11

2016-09-01 Thread Ambrose Bonnaire-Sergeant
mal deref var + invoking path. > http://dev.clojure.org/jira/browse/CLJ-1941 is a similar case with some > discussion in the comments. > > On 09/01/2016 11:33 AM, Ambrose Bonnaire-Sergeant wrote: > > Hi, > > > > There seems to be some issues instrume

Re: [ANN] Clojure 1.9.0-alpha11

2016-09-01 Thread Ambrose Bonnaire-Sergeant
Hi, There seems to be some issues instrumenting functions that compile to .invokePrim calls. user=> (s/fdef blah :args (s/cat :foo int?) :ret any?) user/blah user=> (defn blah [^long a]) #'user/blah user=> (st/instrument) [clojure.core/symbol user/blah] user=> (blah 1) ClassCastException clojure

Re: [ANN] Automatic specs + core.typed release

2016-08-31 Thread Ambrose Bonnaire-Sergeant
Glad to help! Ambrose On Wed, Aug 31, 2016 at 10:33 AM, Eelke van Foeken wrote: > That was it! > > Thank you. > > Op woensdag 31 augustus 2016 16:22:57 UTC+2 schreef Ambrose > Bonnaire-Sergeant: >> >> Try using cidre-nrepl "0.13.0". It might

Re: [ANN] Automatic specs + core.typed release

2016-08-31 Thread Ambrose Bonnaire-Sergeant
ot;] >[org.clojure/math.combinatorics "0.1.3" :exclusions > [[org.clojure/clojure]]] >[org.clojure/tools.analyzer.jvm "0.6.8"] > [org.clojure/core.memoize "0.5.7"] > [org.clojure/tools.analyzer "0.6.7"] > [org.ow2.a

Re: [ANN] Automatic specs + core.typed release

2016-08-31 Thread Ambrose Bonnaire-Sergeant
; Hi, >>> >>> Great feature! I am trying the demo project. I am following the steps >>> from the first example, but when I get to (t/runtime-infer) I get the >>> following error: >>> AssertionError Assert failed: No namespace form found >>> ns-form

Re: [ANN] Automatic specs + core.typed release

2016-08-31 Thread Ambrose Bonnaire-Sergeant
lke van Foeken > > > Op woensdag 31 augustus 2016 11:17:09 UTC+2 schreef Ambrose > Bonnaire-Sergeant: > >> Hi, >> >> The latest core.typed release has support for generating >> clojure.spec specs from unit tests. >> >> [org.clojure/core.typed &

[ANN] Automatic specs + core.typed release

2016-08-31 Thread Ambrose Bonnaire-Sergeant
Hi, The latest core.typed release has support for generating clojure.spec specs from unit tests. [org.clojure/core.typed "0.3.25"] ...; for very recent releases :repositories {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/"} Here's an example

Re: [ANN] Automatic Clojure Type Annotations

2016-08-17 Thread Ambrose Bonnaire-Sergeant
Here's a demo of generating clojure.spec specs + Typed Clojure types for functions and macros. https://www.youtube.com/watch?v=DRJeHthzOjk Thanks for your support! Ambrose On Sun, Aug 14, 2016 at 10:33 PM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Hi

[ANN] Automatic Clojure Type Annotations

2016-08-14 Thread Ambrose Bonnaire-Sergeant
Hi, Happy to announce a new open-source Clojure tool to generate core.typed type annotations from tests. It's part of a new crowdfunding campaign I'm running, read on for details! # What is it? This tool infe

Re: clojure.spec

2016-05-25 Thread Ambrose Bonnaire-Sergeant
Rich, Can you talk about the design process behind fspec? What tradeoffs were in mind for fspec performing gen testing rather than a traditional function contract wrapper a la racket/contract? Thanks, Ambrose On Mon, May 23, 2016 at 5:20 PM, Rich Hickey wrote: > I did most of the design of sp

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-25 Thread Ambrose Bonnaire-Sergeant
to be telling you everything you need to know > wrt to the missing method. > > The dispatch method is opaque (even though it is simple here), so doesn't > make sense to generically add anything additional to this message. > > On Tuesday, May 24, 2016 at 10:53:43 PM UTC-5, Amb

Re: [ANN] Clojure 1.9.0-alpha1

2016-05-24 Thread Ambrose Bonnaire-Sergeant
Thanks for the guide Alex. Is it possible to get more information in the "no method" error returned by multi-spec? (s/explain :event/event {:event/type :event/restart}) ;; val: {:event/type :event/restart} fails predicate: my.domain/event-type, no method It would be nice to mention exactly which

Re: clojure.spec

2016-05-24 Thread Ambrose Bonnaire-Sergeant
t; > > (binding [s/*recursion-limit* 3] > > (time (s/gen ::a))) > > > > > >> On May 23, 2016, at 6:34 PM, Ambrose Bonnaire-Sergeant < > abonnaireserge...@gmail.com> wrote: > >> > >> I'm observing mutually recursive regex op

Re: clojure.spec

2016-05-23 Thread Ambrose Bonnaire-Sergeant
: > Looks like it is, in the meanwhile this patch should fix it: > http://sprunge.us/XTiA > > > > On 23 May 2016, at 23:03, Nicola Mometto wrote: > > > > Possibly CLJ-1544 related? > > > >> On 23 May 2016, at 22:59, Ambrose Bonnaire-Sergeant < >

Re: clojure.spec

2016-05-23 Thread Ambrose Bonnaire-Sergeant
ing the latest master-SNAPSHOT. (ns gen-load.core (:require [clojure.spec :as s])) (s/gen integer?) ;CompilerException java.lang.NoClassDefFoundError: clojure/spec/gen$gen_for_pred, compiling:(gen_load/core.clj:4:1) Thanks, Ambrose On Mon, May 23, 2016 at 5:33 PM, Ambrose Bonnaire-Sergeant < abo

Re: clojure.spec

2016-05-23 Thread Ambrose Bonnaire-Sergeant
t; > > https://github.com/clojure/clojure/commit/4c8efbc42efa22ec1d08a1e9fa5dd25db99766a9 > > > On May 23, 2016, at 5:26 PM, Ambrose Bonnaire-Sergeant < > abonnaireserge...@gmail.com> wrote: > > > > Thanks Rich+team, this is awesome. > > > > Instrumented var

Re: clojure.spec

2016-05-23 Thread Ambrose Bonnaire-Sergeant
Thanks Rich+team, this is awesome. Instrumented vars via `fdef` do not seem to add :doc metadata yet (which is advertised in the docstring for `fdef`). Am I missing something? Thanks, Ambrose On Mon, May 23, 2016 at 5:20 PM, Andrey Grin wrote: > Thank you. Yes, it seems that for recursion I c

Re: Addressing Matthias Felleisen's concerns?

2016-05-09 Thread Ambrose Bonnaire-Sergeant
Josh is correct. I'm currently working on merging this work now that my courses are over. Thanks, Ambrose On Mon, May 9, 2016 at 6:32 PM, Josh Tilles wrote: > On Monday, May 9, 2016 at 5:36:53 PM UTC-4, Didier wrote: >> >> At Clojurewest 2016, Matthias Felleisen gave a great keynote about the >

Re: find shorter clojure code automatically

2016-03-03 Thread Ambrose Bonnaire-Sergeant
Hi Jeremy, Browsing the Kibit rule base comes to mind, but I don't have a general solution. Thanks, Ambrose On Thu, Mar 3, 2016 at 1:33 PM, Jeremy Vuillermet < jeremy.vuiller...@gmail.com> wrote: > Hello, > > Every time I go to a

Re: [ANN] Doubling down on Onyx

2016-02-25 Thread Ambrose Bonnaire-Sergeant
Congrats! On Thu, Feb 25, 2016 at 5:07 AM, Daniel Kersten wrote: > Congratulations! Fantastic news. I think thats my cue to finally go ahead > and learn to use Onyx :) > > On Thu, 25 Feb 2016 at 00:07 Colin Fleming > wrote: > >> Hi Michael, >> >> Congratulations! That's fantastic - I'm really h

Re: Practical ways to deal with 'bag-of-properties' syndrome, AKA dynamic typing?

2015-11-30 Thread Ambrose Bonnaire-Sergeant
Tools like Schema, core.typed or just plain old docstrings are useful. Of course, the library write must provide these. Some libraries even roll their own documentation solution, eg. the very cool tools.analyzer spec . Thanks, Ambrose

Re: [ANN] Clojure 1.8.0-RC2

2015-11-20 Thread Ambrose Bonnaire-Sergeant
ng to > make another change that will affect what the patch will be. > > > On Friday, November 20, 2015 at 9:29:43 AM UTC-6, Ambrose > Bonnaire-Sergeant wrote: >> >> I was going to reopen the ticket and create/test a patch. Does that work >> for you? >&

Re: [ANN] Clojure 1.8.0-RC2

2015-11-20 Thread Ambrose Bonnaire-Sergeant
Aha, thanks! On Fri, Nov 20, 2015 at 10:35 AM, Nicola Mometto wrote: > It doesn't, but direct linking only affects invocations > > > > On 20 Nov 2015, at 15:21, Ambrose Bonnaire-Sergeant < > abonnaireserge...@gmail.com> wrote: > > > > Wait, how doe

Re: [ANN] Clojure 1.8.0-RC2

2015-11-20 Thread Ambrose Bonnaire-Sergeant
I was going to reopen the ticket and create/test a patch. Does that work for you? On Fri, Nov 20, 2015 at 10:22 AM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Alex, > > That sounds correct. > > Thanks, > Ambrose > > > On Fri, Nov 20, 201

Re: [ANN] Clojure 1.8.0-RC2

2015-11-20 Thread Ambrose Bonnaire-Sergeant
Alex, That sounds correct. Thanks, Ambrose On Fri, Nov 20, 2015 at 10:10 AM, Alex Miller wrote: > I see the same and I suspect it's because of the forward declare. :( > > > On Friday, November 20, 2015 at 12:25:28 AM UTC-6, Ambrose > Bonnaire-Sergeant wrote: >>

Re: [ANN] Clojure 1.8.0-RC2

2015-11-20 Thread Ambrose Bonnaire-Sergeant
Wait, how does the compiler know that *clojure-version* isn't a function? On Fri, Nov 20, 2015 at 10:01 AM, Nicola Mometto wrote: > *clojure-version* is not a function, it's not affected by direct linking > > > On 20 Nov 2015, at 14:56, Ambrose Bonnaire-Sergeant < >

Re: [ANN] Clojure 1.8.0-RC2

2015-11-20 Thread Ambrose Bonnaire-Sergeant
I'm missing something, alter-var-root'ing *clojure-version* works just fine when calling (clojure-version). (alter-var-root #'*clojure-version* assoc :qualifier "patched") (clojure-version) ;=> "1.8.0-patched" Thanks, Ambrose On Fri, Nov 20, 2015

Re: [ANN] Clojure 1.8.0-RC2

2015-11-19 Thread Ambrose Bonnaire-Sergeant
I don't think CLJ-1845 had the intended effect. user=> (alter-var-root #'load (fn [f] (fn [& args] (prn "patched") (apply f args #object[user$eval1241$fn__1242$fn__1243 0x1c857e6 "user$eval1241$fn__1242$fn__1243@1c857e6"] user=> (load) "patched" ni

Re: [ANN] Clojure 1.8.0-RC1 is now available

2015-11-14 Thread Ambrose Bonnaire-Sergeant
Can we get a 3rd jar that is AOT compiled but without direct linking? I'd like the benefits of AOT load time but also to build dev-time tooling to improve core error messages. Thanks, Ambrose On Sat, Nov 14, 2015 at 7:02 AM, tcrayford wrote: > Hi, > > I ran Yeller's very extensive benchmark sui

Re: core.typed - Can't resolve alias name

2015-10-29 Thread Ambrose Bonnaire-Sergeant
If you're at the repl, you should use `cf` to evaluate `defalias` also. Sorry for the late response. Thanks, Ambrose On Thu, Oct 29, 2015 at 9:23 PM, JvJ wrote: > Reposting from the core.typed google group. Didn't get a response. > > I'm just starting with core.typed, and I can't seem to get

Re: [ANN] Clojure 1.8.0-beta2

2015-10-27 Thread Ambrose Bonnaire-Sergeant
I've been monkey-patching `clojure.core/load` to add an extension point for alternative compilers. Since I learnt about the direct linking changes, I also had to monkey-patch `use` and `require`, since they refer to `load`. This works. Any interest in disabling direct linking for `clojure.core/loa

Re: "get" returns nil even when "not-found" is supplied?

2015-10-16 Thread Ambrose Bonnaire-Sergeant
Is it possible :incoming-message is mapped to nil? On Fri, Oct 16, 2015 at 2:33 PM, Lawrence Krubner wrote: > What am I doing wrong here? I want to call clojure.string/lower-case on > the :incoming-message of this-users-conversation. If there is no message, I > return an empty string. > > > (de

Re: Weird GenSyms behaviour across different quoted blocks in a macro

2015-08-26 Thread Ambrose Bonnaire-Sergeant
You want an explicit gensym that scopes over both positions. (defmacro a-macro [m] (let [f (gensym "f)] `(fn [~f] ~(for [i# m] `(* (:val ~f) ~i# ) Thanks, Ambrose On Wed, Aug 26, 2015 at 5:07 PM, Rafik NACCACHE wrote: > Suppose I have the following macro, which ge

Re: Tool authors: ClojureScript support in tools.namespace?

2015-07-24 Thread Ambrose Bonnaire-Sergeant
In core.typed I use *parse* and *file* to parse Clojure files and probably ClojureScript files eventually. I resolve the files myself so I don't have strong opinions on 3). Thanks, Ambrose On Sat, Jul 25, 2015 at 5:14 AM, Stuart Sierra wrote: > Hello to anyone and everyone writing tools for wo

Re: Typed Clojure paper draft

2015-07-11 Thread Ambrose Bonnaire-Sergeant
bit more bragging - perhaps > use the word "novel" in the introduction so that the reader appreciates > that you've broken new ground by occurrence typing multimethods. > > On 14 March 2015 at 03:22, Ambrose Bonnaire-Sergeant < > abonnaireserge...@gmail.com> wrote:

Re: Calling an overloaded Scala function

2015-06-26 Thread Ambrose Bonnaire-Sergeant
gives me : > > ([# scala.collection.Seq com.cra.figaro.language.Element>>>, > #>, > com.cra.figaro.language.ElementCollection] > [# scala.collection.Seq, > com.cra.figaro.language.Element>>>, > #>, > com.cra.figaro.language.ElementCollection] > &g

Re: Calling an overloaded Scala function

2015-06-25 Thread Ambrose Bonnaire-Sergeant
That was meant as a response to the other thread. On Fri, Jun 26, 2015 at 10:35 AM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > They apparently differ in the return type. I don't think > clojure.lang.Reflector considers the return type hint > wh

Re: Calling an overloaded Scala function

2015-06-25 Thread Ambrose Bonnaire-Sergeant
They apparently differ in the return type. I don't think clojure.lang.Reflector considers the return type hint when resolving methods. Thanks, Ambrose On Fri, Jun 26, 2015 at 4:16 AM, Stephen Wakely wrote: > javap gives : > > public com.cra.figaro.language.AtomicDist > apply(scala.collection.

Re: Calling an overloaded Scala function

2015-06-25 Thread Ambrose Bonnaire-Sergeant
Do you know how to call this method from Java 1.4? That will probably give enough context to use in Clojure type hints. Thanks, Ambrose On Thu, Jun 25, 2015 at 9:03 PM, Stephen Wakely wrote: > Interesting. That could be a good last resort. > > On Thu, Jun 25, 2015 at 1:27 PM Andy Fingerhut > w

Re: [ANN] Onyx 0.6.0

2015-06-09 Thread Ambrose Bonnaire-Sergeant
Congrats! On Tue, Jun 9, 2015 at 10:35 PM, Michael Drogalis wrote: > I'm happy to announce that Onyx 0.6.0 is officially out! > > Blog post: > http://michaeldrogalis.github.io/jekyll/update/2015/06/08/Onyx-0.6.0:-Going-Faster.html > GitHub: https://github.com/onyx-platform/onyx > Website: www.on

Typed Clojure Crowdfunding 2015 Appeal

2015-06-03 Thread Ambrose Bonnaire-Sergeant
Hi all, I have started a crowdfunding campaign to add "real" Gradual Typing to Typed Clojure. This work will result in more robust interactions with code checked with core.typed, and better integrat

Re: Accessing static fields

2015-05-20 Thread Ambrose Bonnaire-Sergeant
Macros won't work because they are expanded at compile-time. We want to choose the method at runtime. Thanks, Ambrose On Thu, May 21, 2015 at 9:02 AM, Keith Irwin wrote: > Not sure if this helps, but: > > user => (eval (symbol "Math" "PI”)) > 3.141592653589793 > > user => (eval `(. ~(resolve (

Re: Accessing static fields

2015-05-20 Thread Ambrose Bonnaire-Sergeant
Yes, you must use Java reflection. Thanks, Ambrose On Thu, May 21, 2015 at 7:54 AM, Pierre Thibault wrote: > I gave it a try: > > (.. (class String) (getMethod "format" (into-array Class [String > (Class/forName "[Ljava.lang.Object;")]))) > > But I am unable to get the method. I gave up. > > >

Re: any?

2015-04-25 Thread Ambrose Bonnaire-Sergeant
Do you mean any? as in (defn any? [p c] (boolean (seq (filter? p c Thanks, Ambrose On Sat, Apr 25, 2015 at 9:43 PM, Timothy Baldridge wrote: > bleh, hit reply too fast. Or also returns the first true value, so (or > false nil 42) returns 42. > > I guess I don't see when I'd use 'any?' >

Re: Meaning of part of the doc string for `ns-resolve`

2015-04-23 Thread Ambrose Bonnaire-Sergeant
Could you clarify why you expect that? Thanks, Ambrose On Thu, Apr 23, 2015 at 6:43 PM, Brian Marick wrote: > The last sentence of the `ns-resolve` documentation reads: > > Note that > if the symbol is fully qualified, the var/Class to which it resolves > need not be present in the namesp

Re: [ANN] Clojure 1.7.0-beta1 released

2015-04-19 Thread Ambrose Bonnaire-Sergeant
This looks like the minimal case: ;; beta1 user=> (let [x 1] (let [{:keys [a b] :or {a b}} {}] a)) CompilerException java.lang.RuntimeException: Unable to resolve symbol: b in this context, compiling:(/tmp/form-init3618156055290903409.clj:1:12) This returns nil in at least alpha1, could someone

Re: Are keys and vals guaranteed to return in the same order?

2015-04-17 Thread Ambrose Bonnaire-Sergeant
Clearly this assumes immutable maps. On Fri, Apr 17, 2015 at 5:42 PM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > keys/vals are documented > <https://github.com/clojure/clojure/blob/028af0e0b271aa558ea44780e5d951f4932c7842/src/clj/clojure/core.clj#L1478&g

Re: Are keys and vals guaranteed to return in the same order?

2015-04-17 Thread Ambrose Bonnaire-Sergeant
keys/vals are documented to return the same order as seq. This is a safe assumption. Thanks, Ambrose On Fri, Apr 17, 2015 at 5:39 PM, Michael Blume wrote: > > In other people's Cloj

Re: core.typed question (maybe a bug?)

2015-04-16 Thread Ambrose Bonnaire-Sergeant
conceptually. > > > Thanks, > Sven > > Am Donnerstag, 16. April 2015 23:08:30 UTC+2 schrieb Ambrose > Bonnaire-Sergeant: >> >> I don't see an intersection, what do you mean? >> >> Thanks, >> Ambrose >> >> On Thu, Apr 16, 2015 at 4:4

Re: core.typed question (maybe a bug?)

2015-04-16 Thread Ambrose Bonnaire-Sergeant
impossible to call this function as you cannot construct a type of (I Keyword (HVec ...)). Thanks, Ambrose On Thu, Apr 16, 2015 at 5:07 PM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > I don't see an intersection, what do you mean? > > Thanks, > Ambrose >

Re: core.typed question (maybe a bug?)

2015-04-16 Thread Ambrose Bonnaire-Sergeant
rsection in > > (t/HVec [Keyword (t/U Keyword (t/HVec [Keyword Number])) t/Any t/Any *]) > > it works for the definition of the multimethod. Does that make sense? I > thought Union was either one type or the other. > > Thanks, > Sven > > > Am Donnerstag, 16. April

Re: core.typed question (maybe a bug?)

2015-04-16 Thread Ambrose Bonnaire-Sergeant
I don't think second's type is is smart enough. Try using nth or destructuring instead: (let [[f s] v] (if (vector? s) (first s) s)) or (if (vector? (nth v 1)) (first (nth v 1)) s) Thanks, Ambrose On Thu, Apr 16, 2015 at 3:39 PM, Sven Richter wrote: > Hi, > > I have this code: > > (defali

Fwd: [ANN] Clojure 1.7.0-alpha6 released

2015-04-02 Thread Ambrose Bonnaire-Sergeant
core.typed 0.2.86 should be 1.7.0-alpha6 compatible now. Thanks, Ambrose On Thu, Apr 2, 2015 at 4:22 AM, tcrayford wrote: > Yeller (yellerapp.com) (which I maintain) has a comprehensive benchmark > suite > (using criterium, with a heck of a lot of work put into getting real and > good > results

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Ambrose Bonnaire-Sergeant
and should this be fixed? Thanks, Ambrose On Wed, Apr 1, 2015 at 10:28 PM, Alex Miller wrote: > Thanks! If anyone wants to throw a patch, would love to have one. Must > include test ... > > On Wednesday, April 1, 2015 at 8:14:52 PM UTC-5, Ambrose Bonnaire-Sergeant > wrote: >>

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Ambrose Bonnaire-Sergeant
http://dev.clojure.org/jira/browse/CLJ-1692 On Wed, Apr 1, 2015 at 9:12 PM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Ok. > > On Wed, Apr 1, 2015 at 9:10 PM, Alex Miller wrote: > >> I would love a jira for the iterate thIng. >> >> --

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Ambrose Bonnaire-Sergeant
Ok. On Wed, Apr 1, 2015 at 9:10 PM, Alex Miller wrote: > I would love a jira for the iterate thIng. > > -- > 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 mem

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Ambrose Bonnaire-Sergeant
Actually it seems the oddity is that "next" now does the computation instead of "first" in Iterate.java. On Wed, Apr 1, 2015 at 8:56 PM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > AFAICT there is consistently one extra call, which seems to sug

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Ambrose Bonnaire-Sergeant
AFAICT there is consistently one extra call, which seems to suggest an off-by-one error in the IReduce implementation of Iterate. ;; 1.6 user=> (take 11 (iterate (fn [a] (prn (str "PR" a)) (inc a)) 1)) "PR1" "PR2" "PR3" "PR4" "PR5" "PR6" "PR7" "PR8" "PR9" "PR10" (1 2 3 4 5 6 7 8 9 10 ...) ;; 1.7.

Re: [ANN] Clojure 1.7.0-alpha6 released

2015-04-01 Thread Ambrose Bonnaire-Sergeant
Hi, Iterate calls its function after it is finished iterating. ;; clojure 1.6 user=> (take 2 (iterate zero? 0)) (0 true) ;; clojure 1.7-alpha6 user=> (take 2 (iterate zero? 0)) ClassCastException java.lang.Boolean cannot be cast to java.lang.Number clojure.lang.Numbers.isZero (Numbers.java:92)

Re: [GSoC] Typed Transient Proposal

2015-03-27 Thread Ambrose Bonnaire-Sergeant
You should be able to edit the proposal now. Please copy the gist over. On Fri, Mar 27, 2015 at 5:12 PM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Ah yes. Then we're all good! > > On Fri, Mar 27, 2015 at 4:52 PM, Sean Laguna > wrote: > >>

Re: [GSoC] Typed Transient Proposal

2015-03-27 Thread Ambrose Bonnaire-Sergeant
Ah yes. Then we're all good! On Fri, Mar 27, 2015 at 4:52 PM, Sean Laguna wrote: > Hi, > > I did get the melange submission in on time, it just points to the gist. > Presumably that means I'm technically on time? > > Best, > Sean > On Mar 27, 2015 3

Re: [GSoC] Typed Transient Proposal

2015-03-27 Thread Ambrose Bonnaire-Sergeant
ting some of > the reducer/atom/future/do* syntax exactly right was a fun challenge! > > Again, I'd love to hear comments on my proposal, and let me know if > there's anything else I can do in the meantime. > > Best, > Sean > > On Wednesday, March 25, 2015 at 5:05:4

Re: [GSoC] Typed Transient Proposal

2015-03-25 Thread Ambrose Bonnaire-Sergeant
Hi Sean, Sounds like you have greater ambitions than simply supporting transients. Please feel free to disregard any suggestions in the project template and make the *you* would like to implement over the summer. Please post it here or on Melange then we can discuss further. Thanks! Ambrose On W

Re: [GSoC] Typed Overtone proposal

2015-03-24 Thread Ambrose Bonnaire-Sergeant
Try them out here <https://github.com/typedclojure/examples>. Thanks, Ambrose On Tue, Mar 24, 2015 at 4:40 PM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > core.typed supports a restricted form of dependent types via occurrence > typing. Refinement

Re: [GSoC] Typed Overtone proposal

2015-03-24 Thread Ambrose Bonnaire-Sergeant
core.typed supports a restricted form of dependent types via occurrence typing. Refinement types will also be coming later this year. See some examples here . Thanks, Ambrose On Tue, Mar 24, 2015 at 4:34 PM, atucker wrote: > Best of lu

Re: [GSoC] Typed Overtone proposal

2015-03-21 Thread Ambrose Bonnaire-Sergeant
We should work on this proposal, I sent you some suggestions. Thanks, Ambrose On Sat, Mar 21, 2015 at 1:03 PM, Christopher Medrela < chris.medr...@gmail.com> wrote: > Hello! As you may remember I wanted to work at "Source meta information > model" > project during Google Summer of Code this year

Re: [GSoC] Source meta information model proposal

2015-03-20 Thread Ambrose Bonnaire-Sergeant
Hi Christopher, I recommend still sending a proposal for Alex's project just in case. It's hard to predict what constraints we will need to satisfy for project allocation (we might have a small number of allocations from Google, a student may choose a project with another organisation). Thanks, A

Re: Sum up second elemsts of pairs in a sequence by grouping by the first item in pair

2015-03-19 Thread Ambrose Bonnaire-Sergeant
user=> (def a (group-by first [[1 0.5] [1 0.7] [2 1.0] [3 0.1] [3 0.1]])) #'user/a user=> (for [[k vs] a] [k (apply + (map second vs))]) ([1 1.2] [2 1.0] [3 0.2]) On Thu, Mar 19, 2015 at 3:41 PM, Alex wrote: > Hello everybody, > > How to transform sequence > > *[[1 0.5] [1 0.7] [2 1.0] [3 0.1]

Re: Macro Help with Symbols and Evaluation

2015-03-19 Thread Ambrose Bonnaire-Sergeant
If there are a unknown number of layouts you can just define a map from keywords to layouts: {:x_axis BoxLayout/x_axis ..} Otherwise using java reflection is another option. Thanks, Ambrose On Thu, Mar 19, 2015 at 4:34 PM, Mark Bastian wrote: > To provide a little more context, the problem I a

Re: Macro Help with Symbols and Evaluation

2015-03-19 Thread Ambrose Bonnaire-Sergeant
What problem are you trying to solve? On Thu, Mar 19, 2015 at 12:49 PM, Mark Bastian wrote: > Hi All, > > I am trying to write a simple macro to resolve local symbols and I just > can't seem to figure out the right invocation. Here are some commands you > can type/paste in a repl: > > (def ONE 1

Re: compile time evaluation

2015-03-19 Thread Ambrose Bonnaire-Sergeant
Not equivalent, macro expansion happens at compile time, unquotes are evaluated at runtime. On Thu, Mar 19, 2015 at 11:59 AM, danle...@gmail.com wrote: > I noticed the macro #'const in the im.chit/hara library: > https://github.com/zcaudate/hara/blob/master/src/hara/expression/compile.clj#L3 > >

Re: `(apply map vector ...)`, and passing `apply` a list vs. a vector

2015-03-18 Thread Ambrose Bonnaire-Sergeant
[vector] is a vector with the vector predicate. '(vector) is a vector with the symbol 'vector. `(~vector) is similar to what [vector] gives you. On Wed, Mar 18, 2015 at 5:01 PM, John Gabriele wrote: > I see that you can pass extra args to `apply` --- between the func and the > coll args --- an

Re: Typed Clojure paper draft

2015-03-13 Thread Ambrose Bonnaire-Sergeant
ack - I didn't understand what about the > multimethods section justifies the claim of "surprising synergy" in the > introduction. Perhaps you could elaborate on the novelty? > > Chris > El 12/03/2015 02:50, "Ambrose Bonnaire-Sergeant" < > abonnaireserge

Typed Clojure paper draft

2015-03-11 Thread Ambrose Bonnaire-Sergeant
Hi, Please check out our new paper draft on core.typed's type system. The first few pages has a lot of executable code and is intended to be accessible to anyone. Feedback welcome! Thanks, Ambrose -- You received this message because

Re: [GSoC] Mentors contact information

2015-03-09 Thread Ambrose Bonnaire-Sergeant
> at: > > * source metadata information model (mentored by Alex Miller) > * or one of typed clojure projects (mentored by Ambrose Bonnaire-Sergeant). > > Could you share with me contact information to these mentors? > > Best regards! > > -- > You received this messag

Re: defmulti: dispatch function is not called

2015-02-22 Thread Ambrose Bonnaire-Sergeant
Have you tried restarting the REPL? defmulti has defonce semantics. Thanks, Ambrose On Sun, Feb 22, 2015 at 12:52 PM, Timur wrote: > Hi everyone, > > I have the following question regarding the defmultis of clojure: > > (defmulti create-fact > (fn [item-vector] (do > (pr

Re: Summer of Code 2015

2015-02-13 Thread Ambrose Bonnaire-Sergeant
We're planning to apply. On Fri, Feb 13, 2015 at 12:10 PM, Rinu Boney wrote: > Hi all, > > I was wondering if the Clojure community is applying to Google > Summer of Code 2015. The last date for organizations to apply is 20th Feb > and I see no activity from the Clojure community. I have d

Re: Let bindings and immutability

2015-02-11 Thread Ambrose Bonnaire-Sergeant
Local bindings are immutable. Your example demonstrates lexical shadowing of bindings. This is an equivalent program semantically. (let [x 1 x_1 (inc x) x_2 (inc x_1) x_3 (inc x_2)] x_3) By the rules of lexical scoping, you cannot access the first `x` but it is never mutat

Re: debugging "MyClass cannot be cast to MyClass" exceptions

2014-12-06 Thread Ambrose Bonnaire-Sergeant
Perhaps this issue is biting you http://dev.clojure.org/jira/browse/CLJ-979 Thanks, Ambrose On Sat, Dec 6, 2014 at 5:22 PM, Brian Craft wrote: > Yes, I know. ;) In this case it's happening with an uberjar, not with the > repl. I do "java -jar myapp.jar", and later, while it is processing data,

Re: Modelling in Clojure

2014-10-22 Thread Ambrose Bonnaire-Sergeant
this discussion elsewhere, sorry for derailing the OP. Ambrose On Thu, Oct 23, 2014 at 12:21 AM, Fluid Dynamics wrote: > On Wednesday, October 22, 2014 4:51:23 PM UTC-4, Ambrose Bonnaire-Sergeant > wrote: >> >> I missed this in the sequence spec <http://clojure.org/sequence

Re: Modelling in Clojure

2014-10-22 Thread Ambrose Bonnaire-Sergeant
of realized items. > > Jozef > > On Wed, Oct 22, 2014 at 7:51 PM, Ambrose Bonnaire-Sergeant > wrote: > > Sorry, to be specific I'm disturbed by the apparent mutation of an > immutable > > data structure after it has been observed! > > > > Thanks, &

Re: Modelling in Clojure

2014-10-22 Thread Ambrose Bonnaire-Sergeant
On Wed, Oct 22, 2014 at 9:32 AM, Fluid Dynamics wrote: > > and is guaranteed to always produce the same value for the same field. >> > > Nope: > > => (def foo (int-array [1 2 2 5 9 3])) > #'user/foo > => (def bar (seq foo)) > #'user/bar > => bar > (1 2 2 5 9 3) > => (aset foo 3 3) > 3 > => bar > (

Re: annotating functions that use destructuring in core.typed

2014-10-15 Thread Ambrose Bonnaire-Sergeant
oking at your gist. I still don't > *quite* understand the :- syntax, though. Is it just introducing a type > declaration to the data structure that comes after it? > > This is a super cool project, by the way. > > K > > > On Wednesday, October 15, 2014 3:14:58 PM UTC-5, Ambr

Re: annotating functions that use destructuring in core.typed

2014-10-15 Thread Ambrose Bonnaire-Sergeant
Hi, The issue is that you can't use clojure.core/for in typed code. You must use clojure.core.typed/for , and annotate the parameters and expected type. (ann map-span (All [x y y1] [(Map x y) [y -> y1] -> (Map x y1)])) (defn map-span

Re: help with sequence, "seq", Seq, and `seq`

2014-10-08 Thread Ambrose Bonnaire-Sergeant
On Wed, Oct 8, 2014 at 10:55 PM, John Gabriele wrote: > * (when calling `seq` on a coll) "...In either case, if the collection > is empty, `seq` returns nil and never an empty sequence. Functions that > promise to return seqs (not sequences), such as `next`, work the same way." > > I think that

Re: GSoC: Congratulations Aleksandr and Prasant!

2014-08-25 Thread Ambrose Bonnaire-Sergeant
Fantastic! Thanks, Ambrose On Mon, Aug 25, 2014 at 2:15 AM, Mikera wrote: > Hi All, > > Prasant and Aleksandr have been working all summer making Clojure even > better for data science / numerical computing. On behalf of myself and my > co-mentor Alex Ott I want to offer congratulations to the

Re: idiomatic filter-not or inverting predicate

2014-08-21 Thread Ambrose Bonnaire-Sergeant
Also see clojure.core/remove. On Thu, Aug 21, 2014 at 4:04 PM, Sam Ritchie wrote: > I think you want complement, like (filter (complement odd?) ...) > > Andy C > August 21, 2014 at 2:01 PM > Hi, > > > I was wondering what is the nicest way to do filter-not in Clojure. Here > are 3 expressio

Re: Create an instance of a record using a string to define the record's symbol

2014-08-06 Thread Ambrose Bonnaire-Sergeant
u (or anyone) explain me as to why what I was trying > didn't work? > > Thanks Ambrose. > > > On 6 August 2014 11:50, Ambrose Bonnaire-Sergeant < > abonnaireserge...@gmail.com> wrote: > >> Hi Colin, >> >> If you must call the Java constructor, y

Re: Create an instance of a record using a string to define the record's symbol

2014-08-06 Thread Ambrose Bonnaire-Sergeant
Hi Colin, If you must call the Java constructor, you need reflection. user=> (defrecord B [c]) user.B user=> (def s "user.B") #'user/s user=> (.newInstance (first (.getDeclaredConstructors (Class/forName s))) (object-array [1])) #user.B{:c 1} Thanks, Ambrose On Wed, Aug 6, 2014 at 6:37 PM, Col

Re: [ANN] core.cache 0.6.4

2014-08-06 Thread Ambrose Bonnaire-Sergeant
Yes please, help wanted. On Wed, Aug 6, 2014 at 1:16 PM, Yehonathan Sharvit wrote: > Do you intend to support clojurescript? Do you need help? > > > On Wed, Aug 6, 2014 at 7:36 AM, Ambrose Bonnaire-Sergeant < > abonnaireserge...@gmail.com> wrote: > >> Not yet. &

  1   2   3   4   5   6   >