Re: spec key aliasing or different specs for same keyword

2017-12-28 Thread adrian . medina
Avoiding global name collision is the reason why specs are named with namespace-qualified keywords. I am confused by your last sentence though. Do you mean Clojure namespaces or the namespace component of the keyword itself? There is no requirement in clojure.spec that the namespace of the

Re: Minor bug in clojure.zip/path

2017-10-24 Thread adrian . medina
clojure.core/seq? ([x]) Return true if x implements ISeq (seq? []) => false because... (instance? clojure.lang.ISeq []) => false Vectors do not implement ISeq. That's all the seq? predicate cares about. But vectors are `seqable?`: clojure.core/seqable? ([x]) Return true if the seq

Re: CPU & platform for best compilation performance

2017-08-23 Thread adrian . medina
Shot in the dark, but dependent namespace compilation may be the source of your CLJS compiler slowdowns if you have tons of namespaces. Try seeing what happens when you set :recompile-dependents to false in the CLJS compiler options. On Wednesday, August 23, 2017 at 11:54:44 AM UTC-4, Maarten

Re: What kind of dependency is org.clojure/core.specs in a Leiningen project?

2017-06-15 Thread adrian . medina
Consider adding it as a dependency in your :dev profile. On Thursday, June 15, 2017 at 12:25:36 PM UTC-4, 676c...@gmail.com wrote: > > Hello, > > I have a question regarding the Clojure spec split. > > How would a diligent Clojure library author declare the core.specs > dependency in a Leiningen

Re: Starting with Clojure

2017-05-09 Thread adrian . medina
https://clojure.org/community/companies https://clojure.org/community/community_stories Might be insightful for you. Clojure has plenty of commercial use. On Tuesday, May 9, 2017 at 3:59:33 AM UTC-4, Kristian Koci wrote: > > Hello community > > I'm getting started with Clojure, seems like an

Re: Sayid Pro - Transparency for Clojure Production Environments (kickstarter)

2017-05-08 Thread adrian . medina
Thanks for the clarifications and answers! Interested to see what Emacs integration looks like. I'm surprised most developers want web interfaces for this stuff but can't argue with the data if it means more licenses sold for you. On Monday, May 8, 2017 at 1:10:37 PM UTC-4, Bill Piel wrote: >

Re: Sayid Pro - Transparency for Clojure Production Environments (kickstarter)

2017-05-08 Thread adrian . medina
Why is the Pro version acceptable for production use and the free version is not? Is it just the UI/UX improvements? I looked for this in the Kickstarter since I assumed this would be a major selling point, but could not find the answer. Apologies if I missed something. I guess I also have

Re: Using transducers in a new transducing context

2017-04-10 Thread adrian . medina
What you said holds for reduction but not necessarily a parallel fold (see clojure.core.reducers/fold). On Monday, April 10, 2017 at 9:37:29 AM UTC-4, Léo Noel wrote: > > This topic is of high interest to me as it is at the core of my current > works. I had a similar questioning a while ago >

Re: [ANN] core.async 0.3.426

2017-02-23 Thread adrian . medina
Thanks for pointing this out. On Thursday, February 23, 2017 at 6:37:45 AM UTC-5, Max Penet wrote: > > There are new/related issues that crept up with this release fyi. > > I would personally wait the next one for an upgrade in production: > > http://dev.clojure.org/jira/browse/ASYNC-187 >

Re: [ANN] permissions - role & permission based access control

2016-10-13 Thread adrian . medina
My suggestion of a bitmask was just a response to a suggestion of prime factorization for encoding roles in an integer. I think using a set is just fine. The space requirements for a small set of keywords is negligible in the larger scheme of things. It also permits more readable code (always a

Re: [ANN] permissions - role & permission based access control

2016-10-11 Thread adrian . medina
If you wanted to do something more efficient, why not just use a bitmask? That is far more efficient than prime factorization. On Tuesday, October 11, 2016 at 12:06:19 AM UTC-4, larry google groups wrote: > > A minor pet peeve of mine, but is it possible to attach prime numbers to > the roles,

Re: definterface odd error

2016-09-23 Thread adrian . medina
Hey Jeff, The problem is that the code in that blog post is not amenable to copy/paste. The ellipses are standing in for other parts of the code they are leaving out. The exception you're seeing is basically saying that the symbol "..." cannot be treated like an indexed collection. The syntax

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

2016-08-25 Thread adrian . medina
Colin, FWIW, I think you're doing a great job of articulating your points (which I largely agree with) and are providing great feedback for the core team and community to think about. This conversation is supposed to happen as the alpha versions are being iterated on. But I think continually

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

2016-08-25 Thread adrian . medina
I really don't understand how you expect anyone to take your criticism seriously if you keep implying you're happily abandoning the language for greener pastures. Why would anyone developing Clojure look at anything you have to say at this point as anything less than trolling? Back on

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

2016-08-24 Thread adrian . medina
I do not think your tone and lack of constructive feedback to Alex's (and others) thoughtful responses is helping your case. On Wednesday, August 24, 2016 at 8:46:47 PM UTC-4, Brian Marick wrote: > > > On Aug 24, 2016, at 8:39 AM, Stuart Halloway > wrote: > > 3. "Follow

Re: ref strange behavior

2016-08-23 Thread adrian . medina
The lazy sequence works with the code I provided as well. On Tuesday, August 23, 2016 at 9:29:08 AM UTC-4, Sergei Koledov wrote: > > Yes, you are absolutely right. After i modify the code as you advised, it > worked correctly. Thank you very much! > Does it mean that is necessary to avoid the

Re: ref strange behavior

2016-08-23 Thread adrian . medina
Here is working example code demonstrating how you might do this without agents: (in-ns 'user) (def tasks (ref (into clojure.lang.PersistentQueue/EMPTY (range 1 1000 (defn get-task [tasks] (dosync (let [task (first @tasks)] (alter tasks pop) task))) (defn worker-loop

Re: ref strange behavior

2016-08-23 Thread adrian . medina
I haven't run your code yet, but it's bad form to use Clojure's reference types inside other reference types. They should store persistent data structures to really make any sense in a concurrent context. On Tuesday, August 23, 2016 at 8:22:00 AM UTC-4, Sergei Koledov wrote: > > Hello, > > I

Re: taking my clojure game to a higher level

2016-08-21 Thread adrian . medina
I think you just need a project to motivate you to go deeper into the language. Take on a project that you've been wanting to work on for some time and write it in Clojure. On Saturday, August 20, 2016 at 11:59:42 PM UTC-4, chia kang ren wrote: > > I started programming with Racket 2 years ago

Re: Using a function to def other functions?

2016-08-08 Thread adrian . medina
def isn't a good example actually because it's a special form. But the same principle applies when using it as a non-top level form. On Monday, August 8, 2016 at 5:30:12 PM UTC-4, adrian...@mail.yu.edu wrote: > > defn, def, etc are what I mean by "defining macros". > > On Monday, August 8,

Re: Using a function to def other functions?

2016-08-08 Thread adrian . medina
defn, def, etc are what I mean by "defining macros". On Monday, August 8, 2016 at 5:19:04 PM UTC-4, fah...@gmail.com wrote: > > Oh... 'bar' and 'make-step' count as macros? My intent was that they're > ordinary functions that return functions. Am I mistaken? Or does the issue > you referred

Re: Using a function to def other functions?

2016-08-08 Thread adrian . medina
Using defining macros as non top-level forms may not be forbidden by the language but its use is generally discouraged. See http://clhs.lisp.se/Issues/iss104_w.htm for a discussion about this issue in Common Lisp for some background context. In short, compile time effects may not be captured

Re: meaning of spec/and ?

2016-07-21 Thread adrian . medina
Just for future reference this is a mailing list and not a traditional forum, so after you post something here it will email everyone subscribed. On Thursday, July 21, 2016 at 6:24:28 PM UTC-4, Mars0i wrote: > > Ahh... I realized my mistake very soon after I posted the question, and > deleted

Re: Sneaky ways to get people to learn Clojure

2016-07-03 Thread adrian . medina
This is awesome. On Sunday, July 3, 2016 at 1:45:11 AM UTC-4, James Elliott wrote: > > As a spinoff from Afterglow > , my Clojure-based > live-coding environment for light shows, I’ve created a library >

Re: [ANN] Clojure 1.9.0-alpha6

2016-06-15 Thread adrian . medina
Thanks for the link Alex. I understand what changed, but I still don't understand why. Could you elaborate on the thought that went into this? Thank you. On Wednesday, June 15, 2016 at 7:37:52 PM UTC-4, Alex Miller wrote: > > Check out the thread at >

Re: [ANN] Clojure 1.9.0-alpha6

2016-06-15 Thread adrian . medina
I was wondering if you could shed some light on why instrument was changed to not automatically check the :ret and :fn specs. I miss that feature already, hehe, although I understand that these are alpha versions and things evolve. :) I just want to understand the context behind this decision.

Re: clojure.spec

2016-05-23 Thread adrian . medina
This looks incredible and it sounds like something which could immediately be put to good use in both hobby and production projects. Excited to test it out when the alpha is available. Thank you! On Monday, May 23, 2016 at 10:12:29 AM UTC-4, Rich Hickey wrote: > > Introducing clojure.spec > >

Re: Why do "key" and "val" not work on 2-element vectors?

2016-05-04 Thread adrian . medina
I may be misremembering here, but I think this was briefly implemented for an alpha release of 1.8.0. I think the entire feature in question is being reworked for the future, but I'm uncertain of the details. Perhaps others can chime in with the background motivating those changes and

Re: Are strings vectors? Should 'get' docstring be changed?

2016-04-21 Thread adrian . medina
That's a good point, but it should be noted that all collections for which clojure.core/counted? returns true (they implement clojure.lang.Counted) should implement count in constant time. So the design of the Counted interface was clearly intended to provide consumers a soft guarantee of

Re: Are strings vectors? Should 'get' docstring be changed?

2016-04-21 Thread adrian . medina
That's a good point, but it should be noted that all collections for which clojure.core/counted? returns true (they implement clojure.lang.Counted) should implement count in constant time. So the design of the Counted interface was clearly intended to provide consumers a soft guarantee of

Re: Recur in an overloaded function does not work?

2016-04-20 Thread adrian . medina
I don't think you're missing anything James. It does not look like this example uses trampoline with the intended effect. On Wednesday, April 20, 2016 at 2:45:05 PM UTC-4, James Elliott wrote: > > Does trampoline really help in this case? I don’t see where we are ever > returning a new

Re: Recur in an overloaded function does not work?

2016-04-18 Thread adrian . medina
Each arity defined for a particular Clojure function is actually a separate "method" under the hood for that particular functional instance. `recur` in Clojure should be thought of as more like a primitive looping construct than a recursive call to some named function. The documentation for

Re: Pmap on hash maps

2016-04-17 Thread adrian . medina
It depends on your specific use case. Sometimes the overhead of parallelism overshadows the performance gains. The rule of thumb for any language is to first identify bottlenecks in your code through profiling and optimize accordingly. For a concrete example, a while ago I was created a

Re: [ANN] Aleph 0.4.1

2016-04-03 Thread adrian . medina
Awesome! At Vital Labs we use Aleph in production for our HTTP and (soon to be) websocket services. I have nothing but good things to say about it. It makes using Netty a breeze in Clojure. For an unrelated side project, I have been using Aleph to communicate over UDP with an old MMORPG

Re: [ANN] Predicat 0.2.2

2016-03-27 Thread adrian . medina
This looks really interesting and useful. Thanks for sharing. Thinking out loud, it would be interesting to see these failures integrated with something like Probe (https://github.com/VitalLabs/probe), which could not only record the failures but also potentially feed them into a monitoring

Re: Similar lisps and emacs reimplementations?

2016-03-10 Thread adrian . medina
Common Lisp is timeless in my opinion. :) STMX is a high performance STM implementation for Common Lisp. https://github.com/cosmos72/stmx On SBCL it even compiled down as an optimization to Intel TSX assembly instructions (which incidentally were disabled by the manufacturer unfortunately a

Re: Question concerning eval

2016-01-14 Thread adrian . medina
You need to quote the entire vector `avec`, because otherwise the function you want to bind to `foo` will be evaluated before being evaluated by the `let` special operator, which expects only standard readable object literals to be embedded. Try changing: (def avec ['p true 'foo (fn

Re: Primitive pseudocode parser in Clojure

2015-09-21 Thread adrian . medina
I recommend Instaparse (https://github.com/Engelberg/instaparse) for all of your parsing needs. On Monday, September 21, 2015 at 12:29:16 PM UTC-4, Vitaliy Vlasov wrote: > > Hi all, > > I'm happy to write my first post here:) I am writing a mathematical > formula parser in Clojure. The

Re: Why (defn- ...) but (def ^:private? ...)

2015-05-07 Thread adrian . medina
Reader macros are evaluated at read time, not macroexpansion time. Read time happens during reading - the process in which the characters in a file are read into the Lisp forms Clojure supports. Therefore ^:private is not syntax which can be manipulated in a macro, because by the point the

Re: moving from core.async/reduce to transducers

2015-05-06 Thread adrian . medina
It will act exactly like transduce if you put a transducer on the input channel. On Wednesday, May 6, 2015 at 12:26:55 PM UTC-4, Pierre-Yves Ritschard wrote: Hi clojure, There's a thing I find myself doing often in some of my projects where I reduce over a core.async channel this way:

Re: Metadata loss. What am I doing wrong?

2015-05-05 Thread adrian . medina
Because ' is a reader macro which expands to the list (quote some-symbol), so the metadata is applied to the list, and not the symbol. You can verify this in the REPL - (meta (quote ^:abc 'some-symbol)) On Tuesday, May 5, 2015 at 5:43:19 PM UTC-4, Andy- wrote: Frankly, I would've (meta ^:abc

Re: [ANN} Aleph 0.4.0 released, plus Manifold, Dirigiste, and a whole host of other libraries

2015-04-17 Thread adrian . medina
You really hit the ball out of the park with Aleph 0.4.0's API. You have set the standard for simplicity and power in a Clojure API with this release as far as I'm concerned. Thank for your your contribution! On Friday, April 17, 2015 at 5:06:30 PM UTC-4, Zach Tellman wrote: Hey all, In

Re: Composing Stuart Sierra's components

2015-03-11 Thread adrian . medina
I believe I misunderstood your question; I didn't realize it was system (as opposed to any general component) specific. I think systems can be merged together (via 'merge'). Would that help? On Wednesday, March 11, 2015 at 2:40:14 PM UTC-4, Colin Yates wrote: Hi Adrian - I don't follow how

Re: Composing Stuart Sierra's components

2015-03-11 Thread adrian . medina
You can specify component dependencies using the 'using' function as you know. As long as you know the key of the component in the system you can specify this dependency wherever you construct the component. If you want to parameterize dependencies, write a constructor function which takes the

Re: [ANN] Dunaj project, an alternative core API for Clojure

2015-03-05 Thread adrian . medina
Not sure exactly how to properly express my impression here, but it strikes me as odd that this project would not come out of direct collaboration with Clojure's core contributors. Proposed features should probably go through the official channels if you are serious about getting them included

Re: Idiomatic way to co-ordinate 'disconnected' services into a single transaction (ala Spring's @Transactional functionality)?

2015-03-04 Thread adrian . medina
Having never used Spring (or anything else resembling the style of code you presented) I don't really know if I'm understanding what you're asking. However, it might be useful to wrap your database in a component. I do this for Datomic all of the time, and the boilerplate looks something like

Re: Idiomatic way to co-ordinate 'disconnected' services into a single transaction (ala Spring's @Transactional functionality)?

2015-03-04 Thread adrian . medina
Ah I think I understand now! Is it possible to dereference the connection and hold on to the thread local state? If so, then dynamically binding the transactional connection and doing all of your work within that context might be a good solution. You can also write a macro to do this,

Re: Idiomatic way to co-ordinate 'disconnected' services into a single transaction (ala Spring's @Transactional functionality)?

2015-03-04 Thread adrian . medina
(if it's just a regular ThreadLocal, you should be able to get its value through (.get tx)) To elucidate briefly, I mean something like this: (def ^:dynamic *tx*) ;; elsewhere (binding [*tx* (.get tx)] ...do stuff ...cleanup) a with-tx macro would make this pattern reusable throughout

Re: Comparison with atom values

2015-02-12 Thread adrian . medina
You must deref (https://clojuredocs.org/clojure.core/deref) reference values to get the data inside of it. (= @a 0) is the same as saying (= (deref a) 0) Hope this helps! On Thursday, February 12, 2015 at 2:27:39 PM UTC-5, Newbie wrote: I am trying to compare atom values with numbers. For

Re: Architectural doubts

2015-02-01 Thread adrian . medina
If you're interested in efficient binary decoding/encoding with a more pleasant API than standard NIO ByteBuffers, check out Netty's buffer package, io.netty.buffer (http://netty.io/5.0/api/index.html). On Sunday, February 1, 2015 at 7:31:37 AM UTC-5, Milton Silva wrote: For now I'm hand

Re: When to use metadata

2015-01-30 Thread adrian . medina
To be clear, I actually agree with Stuart. I would really like to dig into this topic and hear everyones thoughts on this; it's such a large piece of Clojure's private and public API. On Friday, January 30, 2015 at 1:53:37 PM UTC-5, adrian...@mail.yu.edu wrote: Metadata fields proliferate

Re: When to use metadata

2015-01-30 Thread adrian . medina
Metadata fields proliferate throughout the standard Clojure value and reference types. It seems odd that one would suggest that this seemingly well supported feature should not be taken advantage of except in very narrow circumstances. What is the rationale for such robust support for runtime

Re: [ANN] Neanderthal, a fast, native matrix and linear algebra library for Clojure released + call for help

2015-01-13 Thread adrian . medina
Ditto to the others. This looks great, and I have a lot of core.matrix compatible code I'd love to test it out against! Thanks for releasing this! On Tuesday, January 13, 2015 at 5:07:51 PM UTC-5, Sam Raker wrote: I'd like to politely add to the calls for this to become a pluggable

Re: [ANN] dformat 0.1.0

2015-01-12 Thread adrian . medina
It seems so obvious in retrospect... :) Good job. On Monday, January 12, 2015 at 4:43:08 PM UTC-5, zirkonit wrote: A tiny library, my first open-source Clojure release. Removes some head-scratching when formatting dates (is it or ? or YYY?) by building date format strings

Re: [ANN] Clojure 1.7.0-alpha5 now available

2015-01-11 Thread adrian . medina
For my projects swapping 1.7.0-alpha4 - alpha5 has not culminated in any abnormalities. So... looking good thus far on my end. On Sunday, January 11, 2015 at 11:45:50 AM UTC-5, Plinio Balduino wrote: Hi there, Alex and Clojure team Is there a planned date for the stable version release?

Re: how do you name your protocols?

2014-12-28 Thread adrian . medina
You're overlooking the fact that a service provider interface is simply enterprise design pattern jargon for a subset of public APIs that expose the underlying interfaces of the library to consumers. Saying that Rich is saying protocols should never ever be part of the public API is both

Re: :keys and :or destructuring where defaults refer to one another

2014-12-11 Thread adrian . medina
Whenever you want to get insight in how a macro is rewriting your code, try evaluating your form quoted with macroexpand. Here's a gist with the macroexpansion each form. https://gist.github.com/aamedina/542b084d31d4e0c9a7a8 Hopefully the expansion makes things clear! On Thursday, December

Re: :keys and :or destructuring where defaults refer to one another

2014-12-11 Thread adrian . medina
Common Lisp has a really well thought approach to parameter lambda lists. If you feel strongly about resolving this ambiguity and enforcing consistency around sequential binding in the destructuring syntax, perhaps that would be a good place to root a design you can flesh out in Jira. Here's a

Re: [ANN] async-sockets - work with sockets using core.async channels

2014-10-08 Thread adrian . medina
Check out https://github.com/halgari/com.tbaldridge.hermod for an interesting take on this. On Wednesday, October 8, 2014 1:17:11 AM UTC-4, Sun Ning wrote: BTW, is there any network based core.async channel available now? On 10/08/2014 04:36 AM, adrian...@mail.yu.edu javascript: wrote:

Re: [ANN] async-sockets - work with sockets using core.async channels

2014-10-07 Thread adrian . medina
It's not about 'safety' (depending on what that means in this context), but as Zach pointed out, if you aren't careful about backpressure you can run into performance bottlenecks with unrestrained async IO operations because although they let you code as if you could handle an unlimited amount

Re: Evaluation order

2014-10-07 Thread adrian . medina
*output On Tuesday, October 7, 2014 8:17:34 PM UTC-4, adrian...@mail.yu.edu wrote: You need to flush the input stream after printing. Call (clojure.core/flush) to do so. On Tuesday, October 7, 2014 4:51:05 PM UTC-4, Johannes Langøy wrote: Hi, I can't figure this out. I have these two

Re: Evaluation order

2014-10-07 Thread adrian . medina
You need to flush the input stream after printing. Call (clojure.core/flush) to do so. On Tuesday, October 7, 2014 4:51:05 PM UTC-4, Johannes Langøy wrote: Hi, I can't figure this out. I have these two functions: (defn get-number [] (try (let [input (read-string (read-line))]

Re: Do this or that

2014-10-06 Thread adrian . medina
I agree with James. The first can be tempting when you're doing side effect heavy code (which should probably cause you to take a double take on how you got to this point anyhow) but the most glaring issue that is all too easy to overlook is that they aren't actually equivalent expressions.

Re: core.async: peek the next value from a channel without consuming it

2014-10-05 Thread adrian . medina
I think you can achieve an effect similar to what you want by using a pub with an appropriate topic function that classifies the input in some way, and then subscribing to the topic whose value you want to see. This also has the benefit of automatically 'mult'ing the channel input, so you can

Re: core.async: peek the next value from a channel without consuming it

2014-10-05 Thread adrian . medina
Then how would peeking at the value help? On Sunday, October 5, 2014 12:14:32 PM UTC-4, Nahuel Greco wrote: Adrian: I don't see how a pub can help here, in the previous example to consume or not the value was decided not on some property intrinsic to the value (one you can create a topic

Re: core.async: peek the next value from a channel without consuming it

2014-10-05 Thread adrian . medina
Ah, I think we're on the same page now. I've come across the need for this recently in some code for a UDP based protocol between a multiplayer game client and server. I still think a pub fits in here nicely. You can consume the value from the channel in question and park until you get an

Re: core.async: peek the next value from a channel without consuming it

2014-10-05 Thread adrian . medina
Yes, but the advantage of using a pub is that it's simpler to have one input channel than to continually spawning new ones. But that's just my opinion. Anyway, sorry I couldn't be more help. On Sunday, October 5, 2014 1:04:58 PM UTC-4, Nahuel Greco wrote: You can do that without a pub, the

Re: [ANN] async-sockets - work with sockets using core.async channels

2014-10-05 Thread adrian . medina
Zach makes an excellent point; I've used AsyncSocketChannels and its irk (http://docs.oracle.com/javase/8/docs/api/java/nio/channels/AsynchronousServerSocketChannel.html), with core.async in the past. Perhaps replacing your direct java.net.Sockets with nio classes that can be given

Re: Re: Handling java streams..

2014-10-05 Thread adrian . medina
It's use cases like these that make me wish clojure.lang.Seqable and the like were protocols. Ah, one can dream... On Sunday, October 5, 2014 11:59:15 PM UTC-4, Zach Tellman wrote: Calling (- stream .iterator iterator-seq) should give the desired result. On Wednesday, October 1, 2014

Re: Getting rid of boxing and reflection when working with characters

2014-10-03 Thread adrian . medina
charAt returns a char, not a primitive int, which is why you are getting the ClassCastException java.lang.Character cannot be cast to java.lang.Number exception. The long coercion function will inline to `(. clojure.lang.RT (longCast ~x)), and since that that is a static method which lacks a

Re: Getting rid of boxing and reflection when working with characters

2014-10-03 Thread adrian . medina
You can also call (.getNumericValue (.charAt foo 0)) to get the int the static Character isX methods expect. On Friday, October 3, 2014 2:38:58 PM UTC-4, adrian...@mail.yu.edu wrote: charAt returns a char, not a primitive int, which is why you are getting the ClassCastException

Re: keywords

2014-09-15 Thread adrian . medina
There is no hard limit beyond available memory and JVM class size limitations (which is really only relevant if your creating a ton of keywords statically I think). On Monday, September 15, 2014 3:32:40 PM UTC-4, Paweł Sabat wrote: Hi. How many :keywords can I create in Clojure? Is there

Re: keywords

2014-09-15 Thread adrian . medina
*you're On Monday, September 15, 2014 4:23:46 PM UTC-4, adrian...@mail.yu.edu wrote: There is no hard limit beyond available memory and JVM class size limitations (which is really only relevant if your creating a ton of keywords statically I think). On Monday, September 15, 2014 3:32:40

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-14 Thread adrian . medina
Friendly advice: when you describe anything you create with adjectives like beautiful, it comes off as unnecessarily arrogant to native English speakers. Adrian On Sunday, September 14, 2014 2:47:28 AM UTC-4, dennis wrote: Hi , i am pleased to introduce defun

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2014-09-14 Thread adrian . medina
Criticism accepted Herwig. I apologize for not doing so initially. On Sunday, September 14, 2014 12:15:36 PM UTC-4, Herwig Hochleitner wrote: Hi Dennis, marrying core.match to defn is a pretty neat idea. Thanks for releasing it! I see that you actually extended defn in that you made it

Re: How to use Java library from sources

2014-09-02 Thread adrian . medina
If you can't figure out how to build the JAR, you can try copying the Java source code directly into your Clojure project. Leiningen allows you to specify :java-source-paths in your project.clj, as seen here (https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L276). Then

Re: How can I add meta to an object that doesn't implement IObj?

2014-09-01 Thread adrian . medina
Sorry, I overlooked that you already ruled out all IDeref instances. On Sunday, August 31, 2014 10:21:39 PM UTC-4, Atamert Ölçgen wrote: On Mon, Sep 1, 2014 at 1:52 AM, adrian...@mail.yu.edu javascript: wrote: If you don't want to wrap the object in an atom, you can also reify an

Re: How can I add meta to an object that doesn't implement IObj?

2014-08-31 Thread adrian . medina
If you don't want to wrap the object in an atom, you can also reify an object that supports IDeref which returns your object. All reified objects support IObj out of the box. On Sunday, August 31, 2014 4:55:58 AM UTC-4, Atamert Ölçgen wrote: Hi Francis, On Sat, Aug 30, 2014 at 1:34 PM,

Re: tools.analyzer[.js/.jvm], tools.emitter.jvm, status report

2014-08-13 Thread adrian . medina
You rule Nicola! I really appreciate all of the work you've put into this. Your code has forever influenced the way I write lexical analyzers with Clojure. :) On Wednesday, August 13, 2014 12:54:54 PM UTC-4, Nicola Mometto wrote: As some of you might know, I've been working contiuously on my

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

2014-07-25 Thread adrian . medina
I do not believe this should be considered a bug. Recur is a special form that rebinds the bindings at the point of recursion with new values. It does not return a value. It does not get evaluated in the normal sense of the word. You cannot type check a value on a valueless expression. Just

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

2014-07-25 Thread adrian . medina
I hear what you're saying. Given that recur is a special form, there exists a closed set of exceptions to be worked around like this even theoretically, so I could see the argument for having this patch accepted and not opening pandora's box. On Friday, July 25, 2014 11:36:36 AM UTC-4,

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

2014-07-24 Thread adrian . medina
Indeed this is the case and no; I would not consider it a bug. Because you have specified a post condition on the return value, the clojure.core/fn macro is macroexpanding properly to support that post condition. By recursively macroexpanding the form, you can see the what the form will

Re: Why does unquote clone values?

2014-07-03 Thread adrian . medina
You're going down a rabbit hole here. Evaluating forms at runtime will always result in a slower execution time than a function that doesn't evaluate a form at runtime. On Thursday, July 3, 2014 11:55:02 AM UTC-4, Pascal Germroth wrote: Hi Atamert, Here's a gist with the example code:

Re: syntax tree manipulation

2014-07-03 Thread adrian . medina
If I understand your question correctly, you want to manipulate a deeply nested tree-like data structure, right? If that's correct, then perhaps a combination of clojure.zip and multimethods will suit your needs. Zippers provide a facility to transform (possibly) deeply nested immutable data

Re: Why does unquote clone values?

2014-07-03 Thread adrian . medina
I'm not sure I understand what you're saying here. :( Your example is simply benchmarking the same bit of code in each form. Why would evaluating one explicitly affect that benchmark? Your original example called eval in the body of the functions that you're benchmarking. That is where the

Re: Why does unquote clone values?

2014-07-03 Thread adrian . medina
No I'm benchmarking the functions returned by f1-4. Where did I say different? In any event, I'm trying to help you understand why your benchmarking results are not aligning with your expectations and assumptions about the code you wrote. I would really like to help you gain a greater

Re: When to prefer keywords as functions?

2014-07-03 Thread adrian . medina
I believe you might have seen :when in the binding vector of either a for or deseq form. Their special usage is documented here: http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/for In any event, James explained the distinction quite well. Macros are often used to create

Re: Quil for ClojureScript

2014-03-12 Thread adrian . medina
I wrote a small wrapper over processing.js over the week a few weeks ago, here are some examples with code: http://aamedina.github.io/processing.cljs. It was a lot of fun. =) Good luck with the port! On Tuesday, March 11, 2014 8:26:18 AM UTC-4, Divyansh Prakash wrote: Hello! I am a Java