Re: What is this notation? "-a"

2021-12-26 Thread William la Forge
https://stackoverflow.com/questions/10846423/is-there-a-clojure-convention-for-naming-private-functions/10853372 On Saturday, December 25, 2021 at 6:53:56 PM UTC-5 hank@gmail.com wrote: > Hello -- > > Sometimes I see a notation that uses a prefix "-", as in: > > user> (def -a (atom [])) > #'u

Re: What are resources to learn Clojure for beginners in Programming and get better?

2021-11-03 Thread William la Forge
This may seem silly at times, but I think very highly of it as a starting point: https://www.braveclojure.com/ Also, I suggest that you shift approaches from time to time. Clojure is unbelievably rich and supports programming methodologies that you've never hear of, as well as all the ones you

Re: clojure.edn/read isn't spec compliant

2020-10-17 Thread William la Forge
My understanding is that run-time validation is often left weak in preference to speed of execution. In contrast to validation by the "compiler". Thus clojure throws many more exceptions than does the edn reader. --Bill la Forge On Friday, October 16, 2020 at 9:07:40 PM UTC-4 EuAndreh wrote: >

Re: Making a Java class implement ILookup

2017-03-03 Thread William la Forge
On Friday, March 3, 2017 at 9:42:30 AM UTC-5, Ernesto Garcia wrote: > > > Can you point out to some implementation of this kind? I don't know what > you are referring to here. Would AOT compilation help in my case? > > In the clojure toolbox, the first entry under data structures is aatree: htt

Re: Making a Java class implement ILookup

2017-03-01 Thread William la Forge
Alternative implementations for clojure maps are hard. You tend to use AOT a lot, which is non-idiomatic. But a number of people have done this, including myself. In retrospect, it isn't worth it. At least not most of the time. One thing that really bothers me is that Java supports subMap. And

Re: Is this a bug that is already fixed?

2017-02-19 Thread William la Forge
Upgraded clojure too and now it works. Phew! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To u

Re: Is this a bug that is already fixed?

2017-02-19 Thread William la Forge
Now it gets complicated. I upgraded to the latest clojurescript. and switched to reader version 1.0.0-beta3 which holds the/a fix. No change. The bug is still present. Here's my build boot: https://github.com/rolonicArk/simpleArk/blob/master/build.boot :-( -- You received this message becau

Re: Is this a bug that is already fixed?

2017-02-19 Thread William la Forge
Thanks Timothy! I found a similar issue with the same answer here: https://github.com/ptaoussanis/sente/issues/241 Closed! -- 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

Re: Is this a bug that is already fixed?

2017-02-19 Thread William la Forge
> > I'll note that when I add a second entry to the map, everything is fine: > > {:fix nil :local/contacts-capability contacts-capability} -- 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

Is this a bug that is already fixed?

2017-02-19 Thread William la Forge
Here's my clojure data: {:local/contacts-capability contacts-capability} pr-str gives me this: #:local{:contacts-capability #uuid "--4000-8000-0003"} I pass this over to clojurescript and when I read it I get... Uncaught Error: Could not find tag parser for :local in ("sim

Re: Deploying multiple Clojure apps on one server using Reagent, Nginx, and Supervisor (Solved)

2017-01-02 Thread William la Forge
> > Seth, something seems amiss. 1,000 GB is 1,000,000 MB. At 84 mb per jar, >>> you can spin up 11,904 jar files. Which is worse than only being able to >>> run only dozens of PHP apps. >>> >> --b -- You received this message because you are subscribed to the Google Groups "Clojure" group. T

Re: Cyclic namespace dependencies!

2016-12-31 Thread William la Forge
I think Timothy Baldridge had a great answer. For example, I often have records which use each other's constructors. But you can put your factoy methods in a map of dependencies. I generally have a build function which takes a hash map as an argument, associates the various data and functions t

Re: defrecord in cljc

2016-11-11 Thread William la Forge
To answer my own question, it is because IPrintWithWriter is already defined for records. Only define this with deftype. On Friday, November 11, 2016 at 3:16:46 PM UTC-5, William la Forge wrote: > > WARNING: Protocol IPrintWithWriter implemented multiple times at line 9 > src\

defrecord in cljc

2016-11-11 Thread William la Forge
WARNING: Protocol IPrintWithWriter implemented multiple times at line 9 src\simpleArk\rolonRecord.cljc Any ideas? (ns simpleArk.rolonRecord) #?(:clj (defrecord Rolon-record [rolon-uuid]) :cljs (defrecord Rolon-record [rolon-uuid] ;;this is line 9 IPrintWithWriter

Re: core.async top use cases

2016-10-13 Thread William la Forge
On Thursday, October 13, 2016 at 3:38:16 PM UTC-4, larry google groups wrote: > > So when to use agents? I've looked through Clojure repos on Github, > looking for uses of agents, and I found very few. (I was writing a blog > post about concurrency in Clojure, and I found that agents are among t

Re: parallel sequence side-effect processor

2016-09-23 Thread William la Forge
I've run into this when I wanted to print each item in a seq. Since println returns nil, I just did (first (keep println coll)). --Needed the first here because keep returns a lazy seq. On Friday, September 23, 2016 at 12:02:09 AM UTC-4, Mars0i wrote: > > This is almost the same as an issue I ra

Re: core.async top use cases

2016-09-20 Thread William la Forge
My bad. I was thinking of atomic. Swap! doesn't work with side effects, but send does. On Tuesday, September 20, 2016 at 2:50:53 AM UTC-4, Matan Safriel wrote: > > Thanks but I'm not entirely sure about this. I could use agents for side > effects too, or at least I thought so. Care to further cl

Re: core.async top use cases

2016-09-19 Thread William la Forge
The really nice thing to me is that async handles side-effects while agents do not. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please

Re: Hoplon with websockets

2016-08-07 Thread William la Forge
A little documentation never hurt: https://github.com/hoplon/hoplon/wiki/Hoplon-with-Sente On Friday, August 5, 2016 at 4:48:04 PM UTC-4, William la Forge wrote: > > I've added a new demo to hoplon which uses sente websockets in place of > castra: https://github.com/hoplon/demos/

Hoplon with websockets

2016-08-05 Thread William la Forge
I've added a new demo to hoplon which uses sente websockets in place of castra: https://github.com/hoplon/demos/tree/master/ws-simple#readme The demo is similar to the castra-simple demo, where the client requests and then displays a series of random numbers that are generated by the server. Th

Re: more minimal clojurescript intro/app

2016-04-13 Thread William la Forge
I've never learned javascript and had hoped that clojurescript would make it easy. Much to my delight, I found that hoplon let me write everything in a single language and not have to worry about how html/js are joined. Love Hoplon! https://github.com/hoplon/hoplon -- You received this messag

Re: [ANN] components.md

2016-04-07 Thread William la Forge
Ah, discussions which do not define terms are subject to endless round and rounds. I see several characteristics of a component. The first is that there is a lifecycle. A component may need to be opened and closed. The second is that components are not singletons. So you can have multiple inst

Re: Clojure library

2016-04-01 Thread William la Forge
OK, here is an older library project that uses lein: https://github.com/laforge49/aatree So I guess that covers all the bases. Personally I find boot to be amazing. And easy to use. Bill On Friday, April 1, 2016 at 8:19:46 PM UTC-4, William la Forge wrote: > > OOps. Here's the

Re: Clojure library

2016-04-01 Thread William la Forge
OOps. Here's the link: https://github.com/aatree/aautil/ On Friday, April 1, 2016 at 8:19:01 PM UTC-4, William la Forge wrote: > > Here is a sample library which works the way you are asking. It uses boot, > but then you didn't specify what build tool you wanted to use. :-) &

Re: Clojure library

2016-04-01 Thread William la Forge
Here is a sample library which works the way you are asking. It uses boot, but then you didn't specify what build tool you wanted to use. :-) On Friday, April 1, 2016 at 9:33:45 AM UTC-4, Fernando Abrao wrote: > > Hello all, > > What is the best way to create a lib for internal propose, that gene

[ANN] aatree/aautil release 0.0.8 (a cljc library containing snippets of useful code): building on octet

2016-03-10 Thread William la Forge
Added buffer. Buffer builds on the funcool/octet project, adding a number of capabilities from java.nio.bytebuffer while supporting the extensible specs from octet. See https://github.com/aatree/aautil#buffer -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: ClojureScript sequence implementation does not print

2016-03-05 Thread William la Forge
I found what I needed. In cljs.core we have this (extend-protocol IPrintWithWriter ...) Which defines how to print various sequences. On Friday, March 4, 2016 at 8:07:29 PM UTC-5, William la Forge wrote: > > I've implemented sequences in Clojure with no problems. But I'm

ClojureScript sequence implementation does not print

2016-03-04 Thread William la Forge
I've implemented sequences in Clojure with no problems. But I'm a lot weaker when it comes to clojurescript! When I create an instance of my own sequence type, CountedSequence, and try to print it, all I get is #object[durable.CountedSequence.CountedSequence] Here's the code: https://github.

Re: How to compile with optimizations none when using web workers

2016-02-19 Thread William la Forge
Thomas, Your worker demo includes the entire cljs runtime as part of the project? https://github.com/thheller/worker-example/tree/master/demo/js/cljs-runtime -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloju

Re: How to compile with optimizations none when using web workers

2016-02-19 Thread William la Forge
Thomas, Have you seen this? A simple demo using workers in clojurescript: https://github.com/MarcoPolo/Servant I've converted the demo to use boot: https://github.com/aatree/aademos/tree/master/servant-demo -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: How to compile with optimizations none when using web workers

2016-02-19 Thread William la Forge
Thomas, Modules looks quite exciting. I would be glad to help in developing a boot task for same. Bill -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members a

How to compile with optimizations none when using web workers

2016-02-19 Thread William la Forge
Compiling with optimizations none is no doubt quite handy, especially in conjunction with source maps, as a traceback will take you to the line of code causing the problems, and with the same variable names used in your original clojurescript code. But this is not currently possible for .jc f

Re: record implementing interface with boolean signature, how to???

2016-02-03 Thread William la Forge
Forgot the this parameter. Sorry. Please ignore. :-( On Wednesday, February 3, 2016 at 3:18:34 PM UTC-5, William la Forge wrote: > > Having a bit of a problem implementing the IAtom interface in a record. > Specifically, this is the signature giving me grief: > > boolean compa

Re: record implementing interface with boolean signature, how to???

2016-02-03 Thread William la Forge
The hint seems to have no effect. On Wednesday, February 3, 2016 at 3:28:44 PM UTC-5, Gregg Reynolds wrote: > > > On Feb 3, 2016 2:18 PM, "William la Forge" > wrote: > > > > Having a bit of a problem implementing the IAtom interface in a record. > Specific

Re: record implementing interface with boolean signature, how to???

2016-02-03 Thread William la Forge
data-atom (fn [data] (lset! lens data (apply f (lget lens data) x y args) (^Boolean compareAndSet [oldv newv] (swap! data-atom (fn [data] (let [v (lget lens data)] (if (= oldv v) (lset! lens data newv)

record implementing interface with boolean signature, how to???

2016-02-03 Thread William la Forge
Having a bit of a problem implementing the IAtom interface in a record. Specifically, this is the signature giving me grief: boolean compareAndSet(Object oldv, Object newv); This isn't the answer: (^boolean compareAndSet [oldv newv] ... ) I get "Can't define method not in interfaces: compareA

Re: compare-and-set deep value in hashmap atom

2016-02-01 Thread William la Forge
ed to swap! and do my > side effect only when it's available, It should not happen more than once, > right ? > > On Mon, Feb 1, 2016 at 3:27 PM, William la Forge > wrote: > >> The easy way is the big atom approach. Put the entire structure in an >> atom and use sw

Re: compare-and-set deep value in hashmap atom

2016-02-01 Thread William la Forge
The easy way is the big atom approach. Put the entire structure in an atom and use swap! to make updates. First, the function passed to swap! should be free of side-effects, as swap! may need to call it more than once in the case of a collision. Second, within the function passed to swap! is wh

Re: [ANN] boot-new 0.3.1 -- Templates for Boot!

2016-01-31 Thread William la Forge
levitanong *[*11:30 AM*]* yay I’m not crazy! 1 *[*11:30*]* thanks, @

Re: [ANN] boot-new 0.3.1 -- Templates for Boot!

2016-01-31 Thread William la Forge
Heres the rest... levitanong *[*11:12 AM*]* @flyboarder : Do you think I should file an is

Re: [ANN] boot-new 0.3.1 -- Templates for Boot!

2016-01-31 Thread William la Forge
Ah, but my understanding is that the hoplon template itself does not work. Micha made a fix some time back to the handler wrapper order--it was backwards in the template, but can not himself release it to clojars. >From the hoplon channel: > > levit

[ANN] aautil 0.0.3--lightweight cljc lenses

2016-01-26 Thread William la Forge
AAUTIL is a collection of cljc snippets intended to make writing cljc code easier. It includes code for logging, ultra-light component lifecycle support, and now lenses. https://github.com/aatree/aautil For each snippet there is also a demo written using hoplon. https://github.com/aatree/aademos

Re: Pattern for service with multiple clients using two-way channels?

2016-01-07 Thread William la Forge
So use a mixed approach. Queries are likely best handled by including a return channel with the request. Updates are likely best handled with a flow approach. Complex queries may involve passing a return channel deeper into the process. Especially notification requests. No one answer is best fo

Re: Pattern for service with multiple clients using two-way channels?

2016-01-06 Thread William la Forge
Let each request carry the callback channel. It is then the requestor's option to reuse a channel for multiple requests or to open one for each request or some combination. For example, some requests might get a lot of responses and the requestor may need to close the channel before getting the

Re: clojars down?

2016-01-02 Thread William la Forge
So nice to see clojars working, at least for the moment. Retrieving pod-2.5.5.jar from https://clojars.org/repo/ Retrieving core-2.5.5.jar from https://clojars.org/repo/ Retrieving worker-2.5.5.jar from https://clojars.org/repo/ Retrieving aether-2.5.5.jar from https://clojars.org/repo/ Retrieving

Re: [ANN] dewdrop 0.1.0 -- lenses made simple(r?)

2016-01-02 Thread William la Forge
For me, Dewdrop is an exercise to help me understand lenses. Specter speaks my language in terms of speed of implementation without apologies to the functionally bent. Bill On Saturday, January 2, 2016 at 8:04:30 AM UTC-5, JeremyS wrote: > > Hey guys, > > I might be besides the point but, have

Re: [ANN] dewdrop 0.1.0 -- lenses made simple(r?)

2016-01-01 Thread William la Forge
TC-5, Andrey Antukh wrote: > > > > On Fri, Jan 1, 2016 at 9:53 PM, William la Forge > wrote: > >> Andrey, >> >> This is where I have a problem. Ii could have implemented dewdrop lenses >> as functions that could be composed. But the code would be harder to

Re: [ANN] dewdrop 0.1.0 -- lenses made simple(r?)

2016-01-01 Thread William la Forge
ust use (l/in [:x :y]) > > (l/focus xy-lens {:x {:y 1}}) > ;; => 1 > (l/over xy-lens inc {:x {:y 1}}) > ;; => {:x {:y 2}} > > Happy new year! > Andrey > > On Fri, Jan 1, 2016 at 2:54 PM, William la Forge > wrote: > >> I've been looking at lens

[ANN] dewdrop 0.1.0 -- lenses made simple(r?)

2016-01-01 Thread William la Forge
I've been looking at lenses and while it looks pretty simple and very useful, I had a hard time getting it. So I came up with my own take on lenses. https://github.com/laforge49/dewdrop#readme So perhaps I still do not understand lenses and what I've done is wrong. Or perhaps having been throug

Re: Can I use Clojure to build a mobile chat application?

2015-12-29 Thread William la Forge
Here's a chat demo written in clojure/clojurescript: https://github.com/hoplon/demos/tree/master/castra-chat It is a pretty basic starting point, but it does show how to do a reactive (mobile compatible) web chat. And for a school project it is likely fine. -- You received this message because

Re: [ANN] hoplon/notify release 0.0.1

2015-12-26 Thread William la Forge
OOPS! Manifest error. Released as 0.0.2. Tested the result. Everything runs again. Also defined a deploy-release task in boot.build to make releasing a bit easier. The release is a tad non-standard because of the need to include a .hl file. -- You received this message because you are subscri

[ANN] hoplon/notify release 0.0.1

2015-12-26 Thread William la Forge
Notify is focused on sending server-side notifications to the client for applications building on hoplon and castra. The idea is to have a single poll loop (for now) and to send changes (in the form of notifications) rather than snapshots of server state. Notifications are sequenced and sent in

[ANN] aatree release 0.6.1--Db-chan, Null-db-cache and LRU-db-cache

2015-12-11 Thread William la Forge
The aatree project provides fully compatible alternatives to Clojure sorted-map, sorted-set and vector, with several extensions: - AAVector supports add/drop at any point using addn and dropn. - AAMap and AASet implement Reversible, Counted, Indexed and Sorted - CountedSequence implements Co

[ANN] aatree release 0.6.0--building databases from components

2015-12-06 Thread William la Forge
The aatree project provides fully compatible alternatives to Clojure sorted-map, sorted-set and vector, with several extensions: - AAVector supports add/drop at any point using addn and dropn. - AAMap and AASet implement Reversible, Counted, Indexed and Sorted - CountedSequence implements Co

Re: om next quickstart

2015-11-29 Thread William la Forge
face palm I tried to do a lein clean and it could not find project.cli. I had named the file projects.cli. Clojure error messages will take some getting used to. Thanks Linus! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Re: om next quickstart

2015-11-28 Thread William la Forge
Switched to java version "1.8.0_31" to no avail. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To

Re: om next quickstart

2015-11-28 Thread William la Forge
Perhaps this is the problem? openjdk version "1.8.0_40" -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first p

om next quickstart

2015-11-28 Thread William la Forge
Working my way through the quickstart tutorial for om next: https://github.com/omcljs/om/wiki/Quick-Start-%28om.next%29 Got to the point (not very far) where I enter this command: lein run -m clojure.main script/figwheel.clj clojure.lang.Compiler$CompilerException: java.io.FileNotFoundException

Re: Ultralight Components

2015-11-25 Thread William la Forge
y them inside > functions making it harder to read. > > > On Tue, Nov 24, 2015 at 6:57 AM, James Reeves > wrote: > >> Have you watched Simple Made Easy >> <http://www.infoq.com/presentations/Simple-Made-Easy>? >> >> I mention it because you remark abo

Re: Ultralight Components

2015-11-25 Thread William la Forge
+1 On Wednesday, November 25, 2015 at 8:14:32 AM UTC-5, Colin Yates wrote: > > (let [x …] (if x true false)) is exactly what (if-let [x …] > true false) is for ( > http://stackoverflow.com/questions/2010287/when-to-use-let-vs-if-let-in-clojure > ) > > :-) > > On 25 Nov

Re: Ultralight Components

2015-11-25 Thread William la Forge
James, I've been thinking about protocols. Yes, I can now put them on an aggregate, but there may be a lot of places where it is better not to use a protocol and just use functions instead. The code below does not use a protocol and I rather like it. In other cases we can use functions to achi

Re: Ultralight Components

2015-11-24 Thread William la Forge
On 24 November 2015 at 13:48, William la Forge > wrote: > >> James, thanks for recommending Simple Made Easy >> <http://www.infoq.com/presentations/Simple-Made-Easy>. As usual, I >> strongly agree with 95% or more of everything Rich says. >> >> While listen

Re: Reducing Reuse Coupling

2015-11-24 Thread William la Forge
For greater clarity, I've cleaned up the code and broken it into 2 files, record-play0 and record-play: (ns aatree.record-play0) (set! *warn-on-reflection* true) (defrecord base []) (defn new-base [opts] (-> (->base) (into opts) (assoc :blap (fn [this] 42 (defrecord wackel [

Re: difficulties using extend--'elp!

2015-11-24 Thread William la Forge
Hi Steve! I deleted this post, but still it gets mailed out. Fixes are in and have been posted already. See "Reduces Reuse Coupling". But in any case, thanks. And thanks for the pointer to extend-type. :-) -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: Reducing Reuse Coupling

2015-11-24 Thread William la Forge
Code can be found here: https://github.com/laforge49/aatree/blob/master/test/aatree/record_play.clj -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are mo

Reducing Reuse Coupling

2015-11-24 Thread William la Forge
I love composition of traits and abstractions like protocols. But I especially love clojure's extend, which allows me to refactor interfaces without having to change the code for the traits. That's pretty abstract. We obviously need to look at some code. Lets start by looking at two traits. But

difficulties using extend--'elp!

2015-11-24 Thread William la Forge
This is not working for me: (ns aatree.record-play) (defprotocol gran (blip [x y z])) (defrecord wackel []) (defn new-wackel [opts] (let [w (->wackel)] (into w opts) (assoc w :blip (fn [this x y z] (+ x y z) (extend wackel gran {:blap (fn [this x y z] ((:blip thi

Re: Clojure Objects

2015-11-24 Thread William la Forge
As in quantum entanglement? :-) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from

Re: Ultralight Components

2015-11-24 Thread William la Forge
efactoring, can you show us an example? > > Timothy > > > > On Tue, Nov 24, 2015 at 7:37 AM, William la Forge > wrote: > >> So lets look at some artifacts then. I think we need an interface that >> all composites implement: >> >> (definterface

Re: Ultralight Components

2015-11-24 Thread William la Forge
I better take this off line. I'm getting sloppy. Back to it later. On Tue, Nov 24, 2015 at 9:50 AM, William la Forge wrote: > It occurs to me that this can be simplified by using defrecord in place of > deftype. We can eliminate the Composite interface, because compositeMap &g

Re: Ultralight Components

2015-11-24 Thread William la Forge
)) (defrecord wackel) (defn new-wackel [opts] (assoc opts :blip (fn [this x y z] (+ x y z))) (extend wackel gran {:blip blip}) This is better, but still a bit to swallow. Also, note I fixed a bug in new-wackel. On Tue, Nov 24, 2015 at 9:37 AM, William la Forge wrote: > So lets look at some artifa

Re: Ultralight Components

2015-11-24 Thread William la Forge
So lets look at some artifacts then. I think we need an interface that all composites implement: (definterface Composite (compositeMap [])) The function composite-map returns the map which holds the aggregated functions and data. Now lets look at a sample function, blip: (def blip [^Composite

Re: Ultralight Components

2015-11-24 Thread William la Forge
James, thanks for recommending Simple Made Easy . As usual, I strongly agree with 95% or more of everything Rich says. While listening to this talk, I kept thinking about why I am avoiding protocols. In general, I very much like having abstracti

Re: Ultralight Components

2015-11-23 Thread William la Forge
up the wrong tree with this approach, as it > seems to complicate things without providing any compelling advantages. > > That said, if it's fun then by all means continue to experiment. Maybe I'm > wrong :) > > - James > > On 24 November 2015 at 02:45, William la

Re: Ultralight Components

2015-11-23 Thread William la Forge
Raoul, The problem for me here is that all that terminology refers to classes. What I am dealing with here are objects implemented as persistent maps and operations on those maps. Which is why I'm grasping for terminology. Perhaps I should just define a new term like UltraLight Component (ULC).

Re: Ultralight Components

2015-11-23 Thread William la Forge
aybe I'm missing something. > > Timothy > > On Mon, Nov 23, 2015 at 7:15 PM, William la Forge > wrote: > >> James, when I used the term mixin I was referring to a map that acts like >> a trait that gets merged into a larger map. You would define several such >

Re: Ultralight Components

2015-11-23 Thread William la Forge
James, when I used the term mixin I was referring to a map that acts like a trait that gets merged into a larger map. You would define several such smaller maps that can then be used in various combinations to compose "objects". The identity of the composite object (this) is the map which holds

Re: Ultralight Components

2015-11-23 Thread William la Forge
ered using composition instead of mixins? > > - James > > On 23 November 2015 at 20:01, William la Forge > wrote: > >> When an object is built from a map, aggregating mixins is a trivial >> operation. But when a mixin needs to be closed, it is better to have a &

Ultralight Components

2015-11-23 Thread William la Forge
When an object is built from a map, aggregating mixins is a trivial operation. But when a mixin needs to be closed, it is better to have a common mechanism to manage a stack of the close functions of all the aggregated mixins than to depend on application logic to do so. Case in point, I'd li

Re: Clojure Objects

2015-11-21 Thread William la Forge
Hi James! I'll be the first to admit that I do not yet have a strong case here. And yeah, it looks like I'm introducing some boilerplate myself to do things this way. Which probably just means that I need to learn how to write macros or some such. :-) I was just saying that the calf and yearli

Re: Clojure Objects

2015-11-20 Thread William la Forge
Timothy, I've been thinking about this a bit more and I see that you can supply data via a function in a function map that is part of extend. And while self reference between the various parts of a composite can get awkward, you can always revert to a function to complete that self-reference th

Re: Clojure Objects

2015-11-20 Thread William la Forge
ta as well as methods. On Sat, Nov 21, 2015 at 12:29 AM, Timothy Baldridge wrote: > You might want to read up on records and protocols in clojure. This is > pretty much the use case for which they were designed. > > Timothy > > On Friday, November 20, 2015, William la Forge &g

Re: Clojure Objects

2015-11-20 Thread William la Forge
You can tell I'm still new to clojure. The composition should have been written like this: (-> opts (db-file-open) (db-cache-start) etc) -- 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: Clojure Objects

2015-11-20 Thread William la Forge
James, The advantages of one style over another are often subtle. And indeed, a single object written this way has no real advantage. Poor choice, but it was the only code I have written in this way so far. The addition of closures only occurred to me while writing this piece of code. I includ

Re: Clojure Objects

2015-11-20 Thread William la Forge
Oh! Some minor edits. Which can be found here: https://github.com/laforge49/aatree/wiki/Clojure-Objects -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are

Clojure Objects

2015-11-20 Thread William la Forge
Code as data is the mantra. Functions and closures as data. So why not objects as data? What I propose is nothing new, but perhaps a new style. Making objects from map structures is simple enough in Clojure. And easy enough to put functions in a map. So why not closures? A closure in a map is

Re: Any plan to add log4j 2 support to tools.logging?

2015-11-19 Thread William la Forge
Interesting. The log4j-api is not needed. log4j-slf4j-impl directly interfaces with log4j-core. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderat

Re: Any plan to add log4j 2 support to tools.logging?

2015-11-19 Thread William la Forge
Got it working with aatree. Here's my dependencies: [org.clojure/tools.logging "0.3.1"] [org.apache.logging.log4j/log4j-core "2.4.1"] [org.apache.logging.log4j/log4j-api "2.4.1"] [org.apache.logging.log4j/log4j-slf4j-impl "2.4.1"] Bill -- You received this message because you are subscribed to

Re: Any plan to add log4j 2 support to tools.logging?

2015-11-19 Thread William la Forge
See https://logging.apache.org/log4j/2.x/maven-artifacts.html#SLF4J_Bridge -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient

Re: Any plan to add log4j 2 support to tools.logging?

2015-11-19 Thread William la Forge
log4j2: While the Log4j 2 API will provide the best performance, Log4j 2 provides support for the SLF4J and Commons Logging APIs. Doesn't this mean that log4j 2 now works directly with tools.logging without having to go via slf4j-log4j12? -- You received this message because you are subscribed

Re: Any plan to add log4j 2 support to tools.logging?

2015-11-19 Thread William la Forge
You mean something besides this? [org.clojure/tools.logging "0.3.1"] [org.slf4j/slf4j-log4j12 "1.7.1"] [log4j/log4j "1.2.17" :exclusions [javax.mail/mail javax.jms/jms com.sun.jmdk/jmxtools

aatree release 0.5.3--Transcription makes using aatree easy

2015-11-14 Thread William la Forge
The aatree project provides fully compatible alternatives to Clojure sorted-map, sorted-set and vector, with several extensions: - AAVector supports add/drop at any point using addn and dropn. - AAMap and AASet implement Reversible, Counted, Indexed and Sorted - CountedSequence implements Co

Re: A call for an idiomatic rendering of Clojure EDN in info/error messages

2015-11-13 Thread William la Forge
As a newbie, a red warning flag pops up when I see a back tick. :-) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with y

aatree release 0.5.1--Bugs fixed!

2015-11-12 Thread William la Forge
The aatree project provides fully compatible alternatives to Clojure sorted-map, sorted-set and vector, with several extensions: - AAVector supports add/drop at any point using addn and dropn. - AAMap and AASet implement Reversible, Counted, Indexed and Sorted - CountedSequence implements Co

aatree release 0.5.1--Memory Constrained for Queries

2015-11-08 Thread William la Forge
The aatree project provides fully compatible alternatives to Clojure sorted-map, sorted-set and vector, with several extensions: - AAVector supports add/drop at any point using addn and dropn. - AAMap and AASet implement Reversible, Counted, Indexed and Sorted - CountedSequence implements Co

Re: core.cache limits?

2015-11-03 Thread William la Forge
Sorry to report that after all that, I will need to pull the dependency on core.cache. Dealing with many small items, it is just too slow. Unfortunately I do need a thread-safe cache but really want to avoid sync locks, so I'd rather not roll my own. Guess I can look at the google caches. For n

Re: core.cache limits?

2015-11-03 Thread William la Forge
That is a great post. Unfortunately I had gotten quite flustered by the time I found it and it made little sense to me. But looking at it now it is very well done and quite clear. Sigh. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Re: core.cache limits?

2015-11-02 Thread William la Forge
There was just so much more there than I had ever dreamed. I had looked at destructuring, but had been unaware of the various directives. :D -- 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

Re: core.cache limits?

2015-11-02 Thread William la Forge
Solved by repl. (f :s-history-limit 1000 q-history-limit 1000) is what I want. (I'm finding clojure to be a rich language.) -- 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

Re: core.cache limits?

2015-11-02 Thread William la Forge
OK, after a bit of digging into destructuring, I THINK I just pass the argument {s-history-limit 1000 q-history-limit 1000} or perhaps {:s-history-limit 1000 :q-history-limit 1000}. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

  1   2   >