Ubergraph - request for volunteers to benchmark alternative implementation

2019-08-17 Thread Colin Taylor
I didn't strip it down for a true benchmarking test and my use case is large 
but fairly sparsely connected graphs, but I get about 10% improvement.

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/fb84ca0c-5324-4730-b71c-10a02693d97c%40googlegroups.com.


Re: GMail code formatter

2016-06-16 Thread Colin Taylor
If you install the Borealis theme (
https://github.com/Misophistful/borealis-cursive-theme) it looks even
better IMO

;
;;; Public

(s/defn glob? :- Boolean
  "True if target is a Glob"
  [target :- s/Any]
  (= (type target) Glob))


On 17 June 2016 at 08:34, Alan Thompson  wrote:

> ​​Hmmm, Never thought of that:
>
> (defn truthy?
>   "Returns true if arg is logical true (neither nil nor false); otherwise 
> returns false."
>   [arg]
>   (if arg true false) )
>
> ​Doesn't look half-bad, although ​I don't always have Cursive/IDEA open.
> Alan
>
>
> On Tue, Jun 14, 2016 at 9:38 PM, Colin Taylor 
> wrote:
>
>> Even easier, just copy and paste from Cursive :)
>>
>> --
>> 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 this group, send email to
>> clojure+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


GMail code formatter

2016-06-14 Thread Colin Taylor
Even easier, just copy and paste from Cursive :)

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reworking :pre condition to add an error message

2016-03-29 Thread Colin Taylor
Would there be interest in a ticket in this? Seems simple enough if (as 
above) putting the message under the :pre key is acceptable?


On Thursday, July 14, 2011 at 3:25:16 AM UTC+12, frye wrote:
>
> I do think a simple String error message is all that the user of the 
> function should provide. From there, An AssertionError can throw up 
> something along the lines of what you said - Expected… , Found… , Message. 
> That would give enough information for reporting at least in a test 
> framework. To get more precise information, like you said, that 
> AssertionError could also throw up class/file information, etc. that a 
> debugger could use. I would guard against designing these things to 
> accomodate a context outside of it's execution scope. In the ideal 
> functional world, the input and output are wholly localized. Any 
> Error/Exception thrown can be consumed or chained to give very precise 
> failure reasoning.  
>
>
> As for how that would fit into the entire exception chain, that's still 
> being thought (see here 
> ). There are 
> already a few approaches, and I think this (see here 
> ) is 
> the context of how the core team is approaching this problem. 
>
>
> Cheers 
> Tim 
>
>
> On Tue, Jul 12, 2011 at 6:01 AM, Shantanu Kumar  > wrote:
>
>> As I am the culprit of having introduced it with a naive example, I'd
>> better admit it may not be very useful in practical scenarios across a
>> wide variety of use cases. For example, when there is an assertion
>> error with message "`m` should be a map" 14 levels down the stack, I'd
>> really wish it said "`m` -- Expected: map, Found: vector [:foo :bar]"
>> so that I can debug it quickly.
>>
>> Pre-conditions and Post-conditions are a valuable debugging aid, and
>> to enable that we need very precise information. Unfortunately passing
>> a string error message cannot encapsulate enough error context. A more
>> complex example can be where the correctness of input must be
>> determined collectively (in association with other args) -- in those
>> cases one can only fall back on comparing input values and raise
>> IllegalArgumentException accordingly.
>>
>> Regards,
>> Shantanu
>>
>> On Jul 11, 10:40 pm, Timothy Washington  wrote:
>> > 
>>
>
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


conditional logic implemented as pattern-matching and restructuring in the signature of the function

2016-02-11 Thread Colin Taylor
Defm does this too though I've never got round to fully finishing it.

(defm file-or-string-fn []
  ([File] (println "It's a file"))
  ([s :- String] (println "It's a string " s))
  (["magic"] (println "It's magic"))
  ([_] (println "It's a " (type _1

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


No matching field found: length for class byte array

2015-07-01 Thread Colin Taylor
Yep you're in a cast of confused hundreds? thousands? here. It's quickly 
googlable but I'd still prefer to see my (rejected) humane suggestion in the 
error.
While I don't advocate coding lessons in error messages, this really is an 
anomalous Java detail leaking through.

user=> (.length (int-array 2))
IllegalArgumentException No matching field found: length for class [I, use 
alength function for array length

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: any?

2015-04-26 Thread Colin Taylor
Oh uggh wheres the delete post button.  I'll blame the 3 mth old with 
reflux for that.

On Monday, April 27, 2015 at 12:56:04 AM UTC+12, James Reeves wrote:
>
> Those examples all work with `some` as well:
>
> user=> (some true? [false true false])
> true
> user=> (some even? [1 2 3])
> true
> user=> (some #(.exists %) [(file "1") (file "2") (file "3")])
> true
>
>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: any?

2015-04-25 Thread Colin Taylor
So I was thinking of:

user=> (def any? (comp boolean some))
#'user/any?
user=> (any? true? [false true false])
true
user=> (any? even? [1 2 3])
true
; touch "3"
user=> (any? #(.exists %) [(file "1") (file "2") (file "3")])
true

Some motivations

- my main one is Java interop where use of non booleans would be weird
- similarly it is nicer for APIs to return booleans than a value that is 
kinda arbitrary and potentially non deterministic. I might recall Rich 
saying something like that..?
- the symmetry of `any` joining `not-any`, `every` and `not-every`.

On Sunday, April 26, 2015 at 2:21:26 PM UTC+12, Alex Miller wrote:
>
> I think 'some' fills this role. Given truthy values, why do you need to 
> use boolean with it?
>
> On Saturday, April 25, 2015 at 8:32:09 PM UTC-5, Colin Taylor wrote:
>>
>> Any reason why we don't have `any?`. Googled without much luck.
>> Trivially done as `comp boolean some` not doubt, but I know I use it more 
>> than not-any at least.
>> It's particularly useful as a composable `or`.
>>
>>
>>

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: get all record instances

2011-11-05 Thread Colin Taylor
Actually that does seem the most idiomatic approach

(def sources
  {:bcc source("bbc.. ),
   :google source("),
  }

(defn all-sources []
  (vals sources))

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: get all record instances

2011-11-05 Thread Colin Taylor
Actually that does seem the most idiomatic approach

(def sources
   {:bcc source("bbc.. ),
:google source("),
   }

(defn all-sources []

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


get all record instances

2011-11-05 Thread Colin Taylor
Hi,

given a namespace sources

with [simplified definitions]

(defrecord Source [name url])

(def google (source "Google" "google.com"))
(def bbc (source "BBC" "bbc.co.uk"))
(def nbc ...
etc.

what would be the idiomatic way to implement

(defn get-all-sources)

cheers
Colin

-- 
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 this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en