Re: Some feedback on coding style

2013-05-26 Thread Ambrose Bonnaire-Sergeant
Hi David, Clojure can generate auto-syms with a trailing #. user=> `(fn [x#] x#) (clojure.core/fn [x__349__auto__] x__349__auto__) Thanks, Ambrose On Mon, May 27, 2013 at 9:08 AM, David Pollak wrote: > Mark and James, > > Thank you for your input. > > There are two reasons why I don't want t

Re: Some feedback on coding style

2013-05-27 Thread Ambrose Bonnaire-Sergeant
Hi John, By :pre, do you mean function preconditions? eg. (fn [] {:pre [..]}) ? How is :pre related to metadata and dispatch? AFAICT it's purely for macroexpansion and there is no metadata available on the precondition post-macroexpansion. Thanks, Ambrose On Mon, May 27, 2013 at 9:00 PM, John D

Re: Google Summer of Codeq

2013-05-27 Thread Ambrose Bonnaire-Sergeant
Congrats and good luck! Ambrose On Tue, May 28, 2013 at 9:06 AM, Rich Morin wrote: > I am delighted to report that my notion of a GSoC project on Codeq was (a) > taken up by Navgeet Agrawal and (b) accepted by Google. Paul deGrandis, > Tom Faulhaber, and I will be Navgeet's "official" mentors

Re: [GSoC] core.matrix NDArray project feature requests

2013-05-28 Thread Ambrose Bonnaire-Sergeant
First of all, congrats on the project! Could you elaborate on your mention of QuickCheck, I couldn't find it in the proposal. Thanks, Ambrose On Tue, May 28, 2013 at 4:25 PM, Dmitry Groshev wrote: > Hello, Clojurians. > > I was selected during GSoC process to implement a core.matrix-compatible

Re: Shortcut for variadic map destructuring?

2013-06-06 Thread Ambrose Bonnaire-Sergeant
[& {:as m}] On Fri, Jun 7, 2013 at 3:23 AM, JvJ wrote: > Consider the following: > > (let [ [&{:keys [] :as m}] [:a 1 :b 2 :c 3]] > m) > > ==> {:a 1 :b 2 :c 3} > > Is there a shorter form of [&{:keys [] :as m}]? > > -- > -- > You received this message because you are subscribed to the Goo

Re: [ANN] 'primitive-math', a library for predictable arithmetic operations

2013-06-07 Thread Ambrose Bonnaire-Sergeant
FWIW a third option to determine the exact method called is jvm.tools.analyzer: clojure.tools.analyzer=> (clojure.pprint/pprint (ast (+ 1 2))) {:op :static-method, :env {:source "NO_SOURCE_FILE", :column 29, :line 1, :locals {}, :ns {:name clojure.tools.analyzer}}, :class clojure.lang.N

Re: Reflective method invocation

2013-06-11 Thread Ambrose Bonnaire-Sergeant
Hi Nathan, I just had a quick look at the implementation: I think Clojure picks the first matching method if several are found. https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Reflector.java#L70 It's probably worth testing this out though. Thanks, Ambrose On Tue, Jun 11, 2

Re: [ClojureScript] ANN: core.match 0.2.0-beta2

2013-06-16 Thread Ambrose Bonnaire-Sergeant
Fantastic news! On Mon, Jun 17, 2013 at 1:04 PM, David Nolen wrote: > At long last I've come around to overhauling core.match. > > Changes/Fixes/Enhancements are documented here: > http://github.com/clojure/core.match/blob/master/CHANGES.md > > core.match should no longer have AOT issues as far

Re: type-hints positioning convention?

2013-06-17 Thread Ambrose Bonnaire-Sergeant
After some investigation, the before-the-arglist syntax only seems useful for defining fn's that return primitive types. They don't seem to help resolve reflection calls. (require '[clojure.tools.analyzer :refer [ast]]) ; this creates a double-emitting fn (ast (fn (^double [^double a] a))) ; =>

Re: type-hints positioning convention?

2013-06-17 Thread Ambrose Bonnaire-Sergeant
t; be resolved.* > 3 > user=> (defn foo ^String [^String s] (.substring s 0 (.length s))) > #'user/foo > user=> (.length (foo "jim")) > 3 > user=> (defn ^String foo [^String s] (.substring s 0 (.length s))) > #'user/foo > user=> (.length (foo

Re: type-hints positioning convention?

2013-06-17 Thread Ambrose Bonnaire-Sergeant
mbrose On Tue, Jun 18, 2013 at 1:15 AM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Yes, it did. That's interesting. I have no idea where the .length method > is being inferred from in the last example. > > Carry on :) > > Ambrose > >

Re: type-hints positioning convention?

2013-06-17 Thread Ambrose Bonnaire-Sergeant
ween the 'fn' and the > '[...]' > ...but, you've just demonstrated that this causes reflection...where else > can we put it? > > Jim > > > On 17/06/13 18:33, Ambrose Bonnaire-Sergeant wrote: > > Seems like there's some trickery involved with

Re: Namespace qualification of symbols

2013-06-20 Thread Ambrose Bonnaire-Sergeant
Hi Phil, It's a good question. Syntax quote is designed for generating code/syntax that is deterministic and avoids accidental local name capture. 1. Automatic namespace qualification helps avoid accidental local name capture in macros. user=> `(let [a# 1 b# a] a#) (cloj

Re: Namespace qualification of symbols

2013-06-20 Thread Ambrose Bonnaire-Sergeant
On Thu, Jun 20, 2013 at 8:50 PM, Phillip Lord wrote: > Thanks for the explanation. I was confused. Cheers, glad it helped. Ambrose -- -- 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 No

Re: separate namespace for extra-special forms?

2013-06-23 Thread Ambrose Bonnaire-Sergeant
Special forms are special when used in a list. IMO it's a bad idea to use special forms as local names, a caveat which is surprisingly under-documented. Thanks, Ambrose On Mon, Jun 24, 2013 at 5:38 AM, Ben Wolfson wrote: > This strikes me as pretty odd: > > user> (let [z 1 > try 2

Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-03 Thread Ambrose Bonnaire-Sergeant
This looks fantastic. I probably won't be able to resist to type check it with core.typed at some point. And enough documentation to satisfy Michael Klishin? I'm impressed :) Thanks, Ambrose On Wed, Jul 3, 2013 at 2:07 AM, Dragan Djuric wrote: > I am pleased to announce a first public release

Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-03 Thread Ambrose Bonnaire-Sergeant
On Wed, Jul 3, 2013 at 7:50 PM, Dragan Djuric wrote: > >> I probably won't be able to resist to type check it with core.typed at >> some point. >> > > If you contribute that, or help me baking in (some) non-invasive type > checking into Fluokitten, that would be FANTASTIC! I have that in vague >

Re: Implementation of the special form if

2013-07-18 Thread Ambrose Bonnaire-Sergeant
Hi Burt, See the "eval" and "emit" methods of IfExpr in Compiler.java for evaluation and bytecode output respectively (IIUC) for "if". https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L2551 Thanks, Ambrose On Thu, Jul 18, 2013 at 4:30 PM, Burt wrote: > In whi

Re: Implementation of the special form if

2013-07-18 Thread Ambrose Bonnaire-Sergeant
ks on Boolean.FALSE > > But if we use the function boolean, we get > (boolean falsefalse) ==> false > > Reason: RT.java#L981 checks on the objects booleanValue > > Is this consistent? > > Greetings, > Burt > > > > > Am Donnerstag, 18. Juli 2013 10:36:40 U

Re: [ANN] tools.namespace 0.2.4

2013-07-19 Thread Ambrose Bonnaire-Sergeant
Thanks for your hard work Stuart. Ambrose On Sat, Jul 20, 2013 at 4:37 AM, Stuart Sierra wrote: > *tools.namespace:* utilities to search for, parse, move, and > reload namespaces with awareness of their dependencies > > Release 0.2.4: bug fixes only > > README and source code: > https://github.

Re: [GSoC] CinC mid-term evaluation status

2013-07-31 Thread Ambrose Bonnaire-Sergeant
Very exciting! Keep up the great work Nicola! Ambrose On Thu, Aug 1, 2013 at 12:41 AM, Nicola Mometto wrote: > > For the last month or so I've been working on completing Aaron Cohen's > CinC. > > As planned, this first period has been spent working extensively on the > analyzer improving it to

[ANN] core.typed 0.1.18

2013-07-31 Thread Ambrose Bonnaire-Sergeant
Hi, To mark the mid-GSoC evaluations, I'm happy to release another core.typed version. Highlights: - type checking speed enhancements - some usages of `every?` now update local types as expected - currently works best on things exactly of type IPersistentCollection (aka. a new alias Coll) eg.

Re: [ANN] core.typed 0.1.18

2013-07-31 Thread Ambrose Bonnaire-Sergeant
Probably even more exciting is that we can handle (filter identity coll), although it currently requires instantiating identity: (cf (filter (inst identity (U nil Number)) [1 nil 2])) ;=> (Seqable Number) Finally! Ambrose On Thu, Aug 1, 2013 at 2:31 AM, Ambrose Bonnaire-Serge

[ANN] core.typed 0.1.19 - core.async support

2013-08-03 Thread Ambrose Bonnaire-Sergeant
Hi, This should be exciting news for some, and perhaps the last reason to use Go for others ;) core.typed now includes support for core.async. - typed core.async examples . - companion namespace

Re: [ANN] core.typed 0.1.19 - core.async support

2013-08-05 Thread Ambrose Bonnaire-Sergeant
This release didn't quite go as planned. While trying release core.typed without a core.async dependency I managed to break support for core.async. Fix coming. Thanks, Ambrose On Sun, Aug 4, 2013 at 12:52 PM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: >

Re: [ANN] core.typed 0.1.19 - core.async support

2013-08-05 Thread Ambrose Bonnaire-Sergeant
on, Aug 5, 2013 at 9:29 PM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > This release didn't quite go as planned. While trying release core.typed > without > a core.async dependency I managed to break support for core.async. > > Fix coming. > > Th

[ANN] jvm.tools.analyzer 0.4.3 - CLJS hygienic transformation

2013-08-09 Thread Ambrose Bonnaire-Sergeant
Hi, [org.clojure/jvm.tools.analyzer "0.4.3"] jvm.tools.analyzer now supports transformations on CLJS code. https://github.com/clojure/jvm.tools.analyzer Examples: Normal AST generation: (cljs.tools.analyzer/ast 1);=> {:op :constant, :env {:ns {:defs {a {:column 18, :line 2, :file nil, :name clj

Re: IDE feature

2013-08-09 Thread Ambrose Bonnaire-Sergeant
I'll bet Laurent means paredit-convolute-sexpr :-) Ambrose On Fri, Aug 9, 2013 at 11:09 PM, Sean Corfield wrote: > On Fri, Aug 9, 2013 at 6:58 AM, Laurent PETIT > wrote: > > What does it do? (first time I encounter it) > > DrRacket? It's the "standard" IDE for the Racket language (and all of >

[ANN] core.typed 0.1.24

2013-08-13 Thread Ambrose Bonnaire-Sergeant
Hi, Announcing a new release of core.typed . [org.clojure/core.typed "0.1.24"] There are some breaking changes surrounding the ann-{datatype,protocol} macros, see the changelog and their corresponding var docs for the details. We also now support adding a

[ANN] core.typed 0.2.0 - Production Ready

2013-08-28 Thread Ambrose Bonnaire-Sergeant
Hi, After 10 months and 26 0.1.x releases of transitioning core.typed from an ambitious student project, I am finally comfortable recommending core.typed for production use. Production Ready My interpretation of "production ready" in this context is: - core.typed can *find bugs* in real code - c

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-28 Thread Ambrose Bonnaire-Sergeant
types default to Any > when not Annotated. What was the reasoning behind not mirroring this > behavior for vars, and instead requiring an annotation? > > > On Wednesday, August 28, 2013 5:28:35 PM UTC-5, Ambrose Bonnaire-Sergeant > wrote: >> >> Hi, >> &

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
I see optional typing as the opposite of mandatory typing. You don't need to pass a type checker to get a program semantics. Typed Clojure offers a particular flavour of optional typing: gradual typing. My interpretation of gradual typing is some of your code is rigorously statically typed, some i

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
:35 AM UTC+2, Ambrose Bonnaire-Sergeant > wrote: >> >> Hi, >> >> After 10 months and 26 0.1.x releases of transitioning core.typed from an >> ambitious student project, I am finally comfortable recommending core.typed >> for production use. >> >> Produc

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
Also you can add missing annotations via ann. (ann ^:no-check clojure.core/+ ) Core vars observe the same rules as all vars: they must be annotated. Thanks, Ambrose On Thu, Aug 29, 2013 at 3:44 PM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Hi, > >

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
With Clojure the lines blur between compile time and runtime. The clearest way to put it is that type checking is explicitly called at the REPL or in a unit test. Usually this is done during development iterations or testing time. Re: performance improvements: Michael is correct. Interestingly Ty

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
hings type hinted with expressions would be tricky, but this could work > (or you could just leave it alone): > > myfn (original) > myfn-int > myfn-long > myfn-float > etc > > > > On Thursday, August 29, 2013 6:40:16 AM UTC-5, Ambrose Bonnaire-Sergeant > wrot

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
Yeah, it's probably a lot of work, but it sounds neat. :-) > > > > On Thursday, August 29, 2013 9:07:26 AM UTC-5, Ambrose Bonnaire-Sergeant > wrote: > >> I don't think it would be possible to reconstruct the original forms in >> general, you would need to re

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-29 Thread Ambrose Bonnaire-Sergeant
Just pushed 0.2.1 based on feedback from the video on HN. https://github.com/clojure/core.typed/blob/master/CHANGELOG.md Thanks, Ambrose On Thu, Aug 29, 2013 at 6:28 AM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Hi, > > After 10 months and 26 0.

Re: [ANN] core.typed 0.2.0 - Production Ready

2013-08-30 Thread Ambrose Bonnaire-Sergeant
> command line? > > Shantanu > > > On Thursday, 29 August 2013 22:10:18 UTC+5:30, Ambrose Bonnaire-Sergeant > wrote: > >> Just pushed 0.2.1 based on feedback from the video on HN. >> >> https://github.com/clojure/**core.typed/blob/master/**CHANG

core.typed Blog posts

2013-09-03 Thread Ambrose Bonnaire-Sergeant
Hi, Some new posts on core.typed: - Polymorphic HOFs - Using core.typed at the REPL Also, join #typed-clo

[ANN] lein typed - Check Clojure code with core.typed

2013-09-03 Thread Ambrose Bonnaire-Sergeant
Hi, Announcing lein typed, a tool to use core.typed at the command line. https://github.com/frenchy64/lein-typed Thanks, Ambrose -- -- 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

[ANN] core.typed 0.2.2 - Loading performance

2013-09-03 Thread Ambrose Bonnaire-Sergeant
Hi, Just pushed core.typed 0.2.2. It should be significantly less excruciating waiting for core.typed to initialise. There are also minor documentation/error fixes. [org.clojure/core.typed "0.2.2"] ...; for very recent releases:repositories {"sonatype-oss-public" "https://oss.sonatype.org/conten

Re: [ANN] lein typed - Check Clojure code with core.typed

2013-09-03 Thread Ambrose Bonnaire-Sergeant
Released 0.2.0 which consolidates all commands to `lein typed check ...` on advice of technomancy. Thanks, Ambrose On Wed, Sep 4, 2013 at 2:18 AM, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Hi, > > Announcing lein typed, a tool to use core.typed at t

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

2013-09-04 Thread Ambrose Bonnaire-Sergeant
Hi, core.typed 0.2.3 is up, and comes with two new functions: - statistics - var-coverage *statistics* returns a map o

Re: [ANN] lein typed - Check Clojure code with core.typed

2013-09-05 Thread Ambrose Bonnaire-Sergeant
ing a > namespace? > > On Tuesday, 3 September 2013 11:18:04 UTC-7, Ambrose Bonnaire-Sergeant > wrote: > >> Hi, >> >> Announcing lein typed, a tool to use core.typed at the command line. >> >> https://github.com/frenchy64/**lein-typed<https://github.com/f

Re: [ANN] clojuretip.herokuapp.com

2013-09-07 Thread Ambrose Bonnaire-Sergeant
Nice! :) On Sun, Sep 8, 2013 at 1:09 AM, Steven Degutis wrote: > Yesterday in #clojure: > > To get your random API learnin' of the day, just run: (->> > clojure.core quote the-ns ns-publics seq rand-nth val meta ((juxt :name > :doc)) (map println) dorun) > > Awesome, right? So I put a lil web

[ANN] core.typed 0.2.5, News

2013-09-10 Thread Ambrose Bonnaire-Sergeant
Hi, Pushing another release of core.typed, mostly bug/documentation fixes. We now push a "slim" jar which does not include AOT file. See the README for dependency information. See the CHANGELOG for specific changes. I'm also starting to provide functions t

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: 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: 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: [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

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: 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

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: 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: 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: 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: 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: [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: [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] 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-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 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 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-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
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: [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: [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
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
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
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
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: >>

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: 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

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
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
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: 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: 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: [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: 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: 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: 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: 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 (

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: [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

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: 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
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-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: 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: 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: Code health metrics

2014-07-01 Thread Ambrose Bonnaire-Sergeant
Hi Chris, Dynalint can help identify undefined behaviour. Thanks, Ambrose On Wed, Jul 2, 2014 at 4:53 AM, Chris Ford wrote: > Hi all, > > Are there any good tools for measuring the health of a Clojure codebase? > What is even useful to measure for Cloju

Re: [ANN] tools.namespace 0.2.5

2014-07-16 Thread Ambrose Bonnaire-Sergeant
Fantastic! Thanks Stuart! Ambrose On Wed, Jul 16, 2014 at 9:10 PM, Stuart Sierra wrote: > *tools.namespace:* finding, parsing, and reloading Clojure > namespaces in correct dependency order > > https://github.com/clojure/tools.namespace > > *Release 0.2.5* > > Leiningen dependency: > > [or

Re: NPE on ((print))

2014-07-16 Thread Ambrose Bonnaire-Sergeant
Hi, Parenthesis are for function invocations in Clojure. ((print)) calls the result of print (which is null) aka. nil, which results in a NPE. Thanks, Ambrose On Thu, Jul 17, 2014 at 1:20 AM, wrote: > Hi! > > user=> ((print)) > NullPointerException user/eval1 (NO_SOURCE_FILE:1) > >

Re: Type checking in :pre conditions

2014-07-23 Thread Ambrose Bonnaire-Sergeant
IMO this is good programming practice. If there exists a reasonable contract to check your argument/return value, then use it. You mentioned protocols; if an argument extends a protocol, use {:pre [(satisfies? P a)]} to check your argument. The payoff is localised error messages. Clojure is type

Re: Is this behavior with recur and pre/post a bug?

2014-07-24 Thread Ambrose Bonnaire-Sergeant
Hi Michael, I believe your post condition should read {:post [(number? %)]}. Thanks, Ambrose On Fri, Jul 25, 2014 at 6:56 AM, Michael O'Keefe wrote: > Hello All, > > I encountered the following behavior in Clojure 1.6 and wanted to check if > it should be considered a bug or not. I would say

Re: Is this behavior with recur and pre/post a bug?

2014-07-24 Thread Ambrose Bonnaire-Sergeant
On Fri, Jul 25, 2014 at 12:13 PM, Michael O'Keefe < michael.p.oke...@gmail.com> wrote: > > >- Ambrose, both (number? %) and number? are valid post-condition >forms; the issue is that the post-condition check bumps the recur out of >tail position > > > I'm aware of the context, I just wa

Re: Is this behavior with recur and pre/post a bug?

2014-07-25 Thread Ambrose Bonnaire-Sergeant
Now that Steve mentions it, I have fixed this kind of issue in my own defn macros. IIRC adding an inner loop form did the trick. Thanks, Ambrose On Fri, Jul 25, 2014 at 10:35 PM, wrote: > I do not believe this should be considered a bug. Recur is a special form > that rebinds the bindings at t

Re: Is this behavior with recur and pre/post a bug?

2014-07-25 Thread Ambrose Bonnaire-Sergeant
Yes :pre should apply to every recur, like usual without :post. user=> ((fn [a] {:pre [(number? a)]} (recur 'a)) 1) AssertionError Assert failed: (number? a) user/eval5376/fn--5377 (form-init687485383035947214.clj:1) That probably means that if :post is present, the preconditions should be moved

  1   2   3   4   5   6   >