Re: [ClojureScript] [ANN] thi.ng collection update (CLJ/CLJS)

2015-02-25 Thread Jason Felice
So... what is "computational design"? I've been using OpenSCAD to make models for 3D printing, and I keep wishing for a Clojure syntax and real functions and things. Is this it? (It doesn't seem to have constructive solid geometry for things which aren't meshes.) -Jason On Wed, Feb 25, 2015 at

Packaging JNI extensions

2015-03-13 Thread Jason Felice
I would like to break the JNI part out of Avi and make it a dependency and - hopefully - use it via maven and leiningen like any other dependency. I've come across a bunch of ways of doing this, but they all seem somewhat ... desperate. Does anyone have an example of something that works - multi-

Re: Packaging JNI extensions

2015-03-24 Thread Jason Felice
ct providing the native > library (for several platforms if you need that). Let me know if indigenous > can help ;) > > Hope that helps > > Philippe > > > > > > > > > On Fri, Mar 13, 2015 at 4:02 PM, Jason Felice > wrote: > >> I would like to

[ANN] avi 0.1.6 (searching)

2015-04-04 Thread Jason Felice
endly. Especially to noobs. <https://github.com/maitria/avi#contributing>Contributing We track upcoming work on a Trello board <https://trello.com/b/E2LFvVLy/avi>. This board has many small things that are easy to pick up, and we'd love to see you. I (Jason Felice) would love

Scanners suitable for syntax highlighting?

2015-04-10 Thread Jason Felice
Are there any Clojure or EDN scanners which are useful for syntax highlighting? What would make it useful: 1. It reads '(foo) as left-paren, symbol "foo", right-paren rather than '(foo) (this is because brackets are highlighted independently). 2. It keeps line number and column number informatio

Re: Scanners suitable for syntax highlighting?

2015-04-11 Thread Jason Felice
te for restart) > > Bill > > > On Friday, April 10, 2015 at 5:11:31 PM UTC-5, Jason Felice wrote: > >> Are there any Clojure or EDN scanners which are useful for syntax >> highlighting? >> >> What would make it useful: >> >> 1. It reads '(fo

Re: Supplied-p parameter in clojure similar to lisp lambda lists

2014-06-21 Thread Jason Felice
If you destructure the parameters like this: (defn f [& {:as a-map}] ...) You can use map primitives on a-map. But you can also supply defaults here. On Jun 20, 2014 2:14 PM, "Dave Tenny" wrote: > What is the commonly accepted technique for declaring/using 'supplied-p' > type lambda list funct

Re: leiningen project hooks

2014-06-24 Thread Jason Felice
I think this approach should work. When I've specified hooks in this way, I've specified the function name as well... e.g.: `:hooks [skeletor-clojure.hooks/add-revision-to-config.clj]` (don't let the `.clj` confuse you, the function name is _actually_ `add-revision-to-config.clj`). On Fri, Jun

Re: leiningen project hooks

2014-06-24 Thread Jason Felice
, Jun 24, 2014 at 12:03 PM, Phillip Lord wrote: > > But where did you define the hook? In the project itself. > > My current best solution to this problem is to use an alias and the > lein-exec plugin so I have a sort of working solution now, but I'd still > like it to

[ANN] avi 0.1.5

2014-07-06 Thread Jason Felice
vVLy/avi>. This board has many small things that are easy to pick up, and we'd love to see you. I (Jason Felice) would love to walk through the code with you pretty much any time during the US Eastern work day. Ping me any time on Twitter - I'm @eraserhd <https://twitter.com/eraserh

Re: Clojure & Vim & Ctags (oh my!)

2014-09-04 Thread Jason Felice
Is using tools.analyzer.jvm overkill? Do you want to capture pre-macro-expansion, post-marco-expanion, both? On Thu, Sep 4, 2014 at 2:41 PM, Alan Thompson wrote: > Hi, > > I've been using Clojure & Vim for a year now, with fireplace, etc. > However, it seems that Exuberant Ctags is a bit crip

[ANN] rep 0.2.0 - A single-shot NREPL client designed for shell invocation

2020-10-13 Thread Jason Felice
This release is a complete rewrite in C. All functionality has been preserved, but this version is much more portable and can be added to package managers which cannot package GraalVM. Additionally, the --port option has been extended to be able to find the nREPL port in a file "near" the source

[ANN] specter-edn 0.1.0

2016-06-11 Thread Jason Felice
Hello, all! Here's a new library which works with specter, which will hopefully be useful for writing code transformations and queries. specter-edn Specter paths for working with formatted EDN and Cloure code. There is one specter path: SEXPR. This navigates to a sequence of s-expressions parse

Re: Clojure for the Brave and True - infix notation exercise

2016-06-24 Thread Jason Felice
Recursive descent parsers are much smaller for simple cases. Basically, you write one function per level of precedence, and each tries, greedily, to consume as much as possible for that level of precedence. e.g. (defn parse-level1 ;; + and - [list] ... ; calls parse-level2 repeatedly so long

Re: [ANN] better-cond 1.0.1

2016-07-01 Thread Jason Felice
You've got me thinking whether there's a more general thing which could be done for packthread: (https://github.com/maitria/packthread). Hrmm... On Fri, Jul 1, 2016 at 5:25 AM, Mark Engelberg wrote: > I should add that Dunaj already has this feature, so if you are a user of > Dunaj you do not n

Re: Good Open Source project to learn Clojure

2016-07-15 Thread Jason Felice
We'd love to have you on Avi: https://github.com/maitria/avi If you normally use vim, the problem domain is easy to understand, and it provides plenty of interesting problems to solve. -Jason On Fri, Jul 15, 2016 at 6:49 AM, Cecil Westerhof wrote: > I did not work with Clojure for about a yea

Re: Displaying functions generated for the REPL

2016-07-23 Thread Jason Felice
If they are all in one namespace, you can use `ns-publics` on that namespace ... e.g. `(ns-publics 'user)`. On Sat, Jul 23, 2016 at 5:28 AM, Cecil Westerhof wrote: > For a project I define some extra functions if it is started in the REPL. > I like to know which extra functions there are in the

Re: idiomatic way of counting loop iteration

2016-09-09 Thread Jason Felice
Generally speaking, `loop`, `recur`, and writing recursive functions are not idiomatic in Clojure. Using things like `iterate`, `map`, and `filter` are considered clearer. If `n` is used just to count iterations, then `iterate` would be useful. e.g. (first (drop n (iterate (fn [[a b]] ... [new-a

[ANN] Avi 0.1.9 - The Splits

2016-10-25 Thread Jason Felice
<https://trello.com/b/E2LFvVLy/avi>. This board has many small things that are easy to pick up, and we'd love to see you. I (Jason Felice) would love to walk through the code with you pretty much any time during the US Eastern work day. Ping me any time on Twitter - I'm @eraserhd &l

Re: Help me understand what part of this code is slow, and how to make it faster?

2016-11-16 Thread Jason Felice
I'll bet the atom accesses dominate the computation. They are a part of Clojures software transactional memory (STM) and have a cost. Something like this (untested) should be faster: (->> (iterate neighbors #{p}) (drop 1999) first) neighbors could be: (into #{} (for [[id jd] [[-1 0] [+1 0] [0

Re: Are there file watchers that can tell me when a file is done uploading?

2016-12-12 Thread Jason Felice
At least back in the day, on Windows, the file size would stay zero until the file was closed. On Mon, Dec 12, 2016 at 11:19 AM, larry google groups < lawrencecloj...@gmail.com> wrote: > > > My inclination would be to watch for files in a directory, then poll > their filesize. If it > > remains s

Re: Navigators and lenses

2017-03-10 Thread Jason Felice
I'm very curious why most lens libraries don't just use fns with arity 1 and 2. (I'm going to guess that Specter doesn't because it wants more introspection into the lenses for optimization purposes.) On Thu, Mar 9, 2017 at 4:25 PM, Mark Engelberg wrote: > On Mar 9, 2017 9:52 AM, "Brandon Bloom

Re: Is it normal for exercise-fn to return examples that don't conform?

2017-04-03 Thread Jason Felice
That's a complicated question, but the simplified answer is: test.check (which clojure.spec uses) generates random test cases. This is advantageous when the state space is very large, where tracking previous examples is hard and gives very little advantage. When the state space is small, there w

[ANN] specter-edn 0.1.2

2017-05-16 Thread Jason Felice
Thank you to Marcelo Nomoto for bug fixes and updating the dependencies! specter-edn Specter paths for working with formatted EDN and Cloure code. There is one specter path: SEXPR. This navigates to a sequence of s-expressions parsed from a string. For the transform case, specter-edn preserves

Re: [ANN] specter-edn 0.1.2

2017-05-16 Thread Jason Felice
And, I forgot the link: https://github.com/maitria/specter-edn > > -- 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 yo

[ANN] specter-edn 0.1.3 - Format-preserving transforms for EDN and CLJ

2017-05-30 Thread Jason Felice
!\n6]" <https://github.com/maitria/specter-edn#todo>TODO - Use clj-format to format new code which isn't matched up with old code. <https://github.com/maitria/specter-edn#contributors>Contributors - Jason Felice - Marcelo Nomoto <https://github.com/maitria/spe

[ANN] specter-edn 0.1.4

2017-07-17 Thread Jason Felice
ODO - Use clj-format to format new code which isn't matched up with old code. <https://github.com/maitria/specter-edn#contributors>Contributors - Jason Felice - Marcelo Nomoto <https://github.com/maitria/specter-edn#license>License Copyright © 2016, 2017 Jason M. Fel

[ANN] packthread 0.1.10

2018-04-03 Thread Jason Felice
This release handles `if-some` and `when-some` and supports ClojureScript. packthread https://github.com/maitria/packthread "Heavy" threading macros. Why? Because every time you've wanted to: (-> 42 (let [x 79] (+ x)) inc) but clojure wouldn'

Re: lein midje not working

2018-04-12 Thread Jason Felice
On Wed, Apr 11, 2018 at 9:21 PM Renata Soares wrote: > I found the problem... in my core.clj i was using (slurp *in*) to get > contents via stdin. > 'lein midje' performs 'lein run' first? > Not specifically, but your test namespace requires it, so it will run and top-level code in it. In Cloju

[ANN] parinfer-rust 0.2.0 (Vim plugin and library)

2018-04-27 Thread Jason Felice
... the first "ready for public consumption" release. One of the the initial reactions was, "This. Is. Awesome!" Just sayin'.parinfer-rust https://github.com/eraserhd/parinfer-rust A full-featured, super snappy port of Shaun Lebron's parinfer to Rust. T

Re: [ANN] Datomic Ions: Your App on Datomic Cloud

2018-06-07 Thread Jason Felice
This looks really amazing! Seems like it would make a solid platform for a startup. -Jason On Thu, Jun 7, 2018 at 7:22 AM Marc Limotte wrote: > Funny. When I read the Subject line I thought this was just another > release of Datomic Cloud >

Re: [ANN] scope-capture 0.3.0

2018-07-17 Thread Jason Felice
This looks very useful! Thanks! On Tue, Jul 17, 2018 at 9:19 AM Val Waeselynck wrote: > Just released *scope-capture > * 0.3.0, with some new > goodies: > > - spyqt / brkqt >

Re: Pipe shell output into REPL?

2018-09-06 Thread Jason Felice
You can use tmux and run your REPL inside a pane. You can then use the tmux commands set-buffer and paste-buffer, wrapped in a little shell, to send text to the REPL. (This is actually how the Kakoune editor does REPLs.) On Wed, Sep 5, 2018 at 9:56 PM Didier wrote: > Hi all, > > I was wonderin

Re: [ANN] 1.10.0-beta5

2018-11-06 Thread Jason Felice
This pattern appears in clojure.zip, also. (Any point in updating that?) On Tue, Nov 6, 2018 at 10:51 AM Alex Miller wrote: > > On Tuesday, November 6, 2018 at 9:25:31 AM UTC-6, John Schmidt wrote: >> >> Nice to see continued progress on Clojure 1.10! >> >> It is not clear to me what metadata e

[ANN] rep 0.1.0 - A single-shot nREPL client (hence no 'L')

2018-12-19 Thread Jason Felice
rep https://github.com/eraserhd/rep A single-shot nREPL client designed for shell invocation, to be used as a part of editor tooling, scripting, or monitoring. Binaries are built with Graal VM, so it has super-quick boot and turn-around time. For example, it takes 25ms to execute "(+ 2 2)" in a

[ANN] rep 0.1.1 - A single-shot nREPL client designed for shell invocation

2019-01-08 Thread Jason Felice
Changes - Add -n, --namespace option to specify the namespace of evaluated code. - Add -l, --line option to specify the file, line number, and column of evaluated code. - Now releasing Linux binaries (thanks Circle CI!) - Documentation updates, including an example of how an editor

[ANN] rep 0.1.2

2019-02-18 Thread Jason Felice
rep is a single-shot nREPL client designed for shell invocation. In this release, --op, --send, and --print options have been added, allowing sending of any kind of nREPL message (not just "eval") and formatting any kind of reply for shell interpretation. https://github.com/eraserhd/rep This con

Re: [ANN] rep 0.1.2

2019-02-21 Thread Jason Felice
On Thu, Feb 21, 2019 at 2:28 AM Didier wrote: > Hum, is there some advantage to using this over just normal `clj -e`? > It's intended more for shell scripting remote control of an *existing* Clojure process and editor/REPL integration for editors that lean on the POSIX shell. It's a Graal nativ

[ANN] select-nrepl 0.1.0 Editor-independent Clojure text object support

2019-03-20 Thread Jason Felice
select-nrepl https://github.com/eraserhd/select-nrepl Text-object support for your editor as nREPL middleware. This uses clj-rewrite to parse the source, so it has a very good understanding of comments, metadata, and reader literals. It's also designed so that repeating a selection command does

Re: [ANN] select-nrepl 0.1.0 Editor-independent Clojure text object support

2019-03-21 Thread Jason Felice
You're welcome! If you integrate this with your editor, let me know so I can link to it. On Wed, Mar 20, 2019 at 7:30 PM Andrea Richiardi wrote: > Wow this is awesome! Thank you! > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to t

Re: [ANN] tarantella 1.1.1

2019-07-29 Thread Jason Felice
This is really nice talk that's given me a bunch to think about. Thanks! On Mon, Jul 29, 2019 at 4:23 AM Mark Engelberg wrote: > "You won't believe this one weird trick for solving Sudokus and other > puzzles." > > Tarantella is an implementation of Knuth's Dancing Links algorithm. I > demonstr

[ANN] parinfer-rust 0.4.0 (emacs support!)

2019-10-01 Thread Jason Felice
Thanks to Justin Barclay, parinfer-rust, and therefore Parinfer's Smart Mode, is now available for emacs! parinfer-rust Infer parentheses for Clojure, Lisp and Scheme. https://github.com/eraserhd/parinfer-rust A full-featured, super fast implementation of Shaun Lebron’s parinfer

Re: Keys in EDN maps: keywords or symbols

2019-10-24 Thread Jason Felice
My personal opinion is to prefer keywords, and prefer less preprocessing of the configuration before the program uses it. If it gets to a place where the configuration changes a lot, and a "natural" (read: clojure-like) expression of the configuration in EDN has either a lot of redundancy, or bits

Re: JNA stdout and the REPL

2020-02-14 Thread Jason Felice
I imagine you'll have to call the Java System.out.println from C. I forget how exactly to do this. Java streams and ANSI/POSIX C streams aren't compatible. The C ones usually rely on having an OS file descriptor, and Java allows making new kinds by implementing interfaces. There's not a general

Re: Conceptual difference between map and class

2020-03-31 Thread Jason Felice
A subtle difference between a map of functions and a Python class is that the class has implicit "self" or "this". Otherwise, these are semantically the same. Well, ignoring that Clojure maps are immutable. In fact, C++ compilers compile methods by inserting a first "this" argument and mangling

Re: [CfP] 2nd Call - 2020 Scheme and Functional Programming Workshop

2020-05-18 Thread Jason Felice
Will the actual conference will be online this year? Do you know approximately when? On Sun, May 17, 2020 at 2:15 PM Jason Hemann wrote: > Hello, > > Thank you for your attention, and my apologies for any duplication you > receive. Please find below the Call for Papers for the *2020 Scheme and

Re: [ANN] prismatic/schema 1.0 adds automatic test data generation

2015-09-02 Thread Jason Felice
I have a question: "both" is deprecated with a note to use "s/conditional" instead. However, that doesn't work for my case. I have the following: (s/both s/Int (s/pred pos?)) If I rewrite it to (s/conditional pos? s/Int), this throws: (s/check (s/conditional pos? s/Int) "") Since (as far as I

Re: [ANN] prismatic/schema 1.0 adds automatic test data generation

2015-09-03 Thread Jason Felice
On Wed, Sep 2, 2015 at 9:56 PM, Jason Wolfe wrote: > > Outside of that, I can still potentially see the desire to specify > postconditions rather than preconditions (you'd rather see an error (not > (integer? "1")) than (throws? (odd? "1")), which will be the behavior when > the bug is fixed. We'

Re: cond->: Using of threading expression in tests?

2015-10-02 Thread Jason Felice
This doesn't work, as (fn [x] (= (:x x) 1)) is never evaluated and the function itself is always truthy. (Same for the #(= (:x %) 1) version). On Fri, Oct 2, 2015 at 9:00 AM, Colin Yates wrote: > Alternatively you can do (cond-> {:x 1} (fn [x] (= (:x x) 1)) (assoc :x > 2)) > > On 2 Oct 2015, at

The middleware pattern

2015-10-02 Thread Jason Felice
Why is it so hard to describe to new people? I mean, the questions I get are (I understand what's happening here, but I can't describe it well): 1. If -> threads things first-to-last, why does the middleware run last-to-first? 2. Why is comp backwards? 3. Wait, so how does each wrapper get a seco

Re: The middleware pattern

2015-10-02 Thread Jason Felice
nd open it to reveal the second largest, etc. >> >> Imagine the function as a marble, and Russian Dolls as middleware. To put >> the marble inside the dolls you wrap it in the smallest doll first. To call >> the function (retrieve the marble) you need to open the largest, ou

Re: The middleware pattern

2015-10-02 Thread Jason Felice
outside-in". > > ((comp not zero?) x) == (not (zero x)) > > So it reads in the same order from left-to-right as it would otherwise. > > > On Friday, October 2, 2015 at 1:10:54 PM UTC-6, Jason Felice wrote: >> >> Why is it so hard to describe to new people? >

Re: [ANN] prismatic/schema 1.0 adds automatic test data generation

2015-10-26 Thread Jason Felice
Thanks! I'll try it out this week and let you know. On Sun, Oct 25, 2015 at 8:28 PM, Jason Wolfe wrote: > FYI -- we just released Schema 1.0.2, which adds `s/constrained` for > postconditions. > > -Jason > > On Thursday, September 3, 2015 at 3:05:29 PM UTC-3, Jason Fe

Re: [ANN] prismatic/schema 1.0 adds automatic test data generation

2015-10-26 Thread Jason Felice
ed by: #'schema.core/atom But I can't figure out why, because schema.core is clearly excluding atom. This project is on clojure 1.7.0. -Jason On Mon, Oct 26, 2015 at 11:58 AM, Jason Felice wrote: > Thanks! > > I'll try it out this week and let you know. > > On Sun, O

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

2015-11-13 Thread Jason Felice
+1 for backquotes, as I understand then without needing to think about it because of markdown. (I use them in docstrings and commit messages and error messages, too.) On Nov 13, 2015 10:26 AM, "Steve Miner" wrote: > For what it’s worth, I like to use matching `backquotes` as a meta-syntax. > > (d

arity-3 `iterate`

2015-11-16 Thread Jason Felice
I *frequently* see: (nth (iterate foo bar) n) And: (->> (iterate foo bar) (drop n) first) I've also coded this in `avi` after being surprised no such thing exists: (defn n-times [thing n a-fn] (reduce (fn [thing n] (a-fn thing)) thing (range n))) (which is kind of

[ANN] packthread 0.1.7

2015-11-18 Thread Jason Felice
*https://github.com/maitria/packthread * *Changes:* - Metadata attached to `fn+>` is preserved. - Documentation updated and my silly rant removed. packthread "Smarter" threading macros.

[ANN] avi 0.1.7

2015-11-30 Thread Jason Felice
defeat vim muscle memory. - Code is for people. Be expressive as hell. - Be friendly. Especially to noobs. <https://github.com/maitria/avi#contributing>Contributing We track upcoming work on a Trello board <https://trello.com/b/E2LFvVLy/avi>. This board has many small things that ar

Re: Guidance on modelling listeners

2015-12-07 Thread Jason Felice
It looks like you want dynamic registration of event handlers, which is not something I've done. If you *didn't* want that, then this the middleware pattern: (defn null-processor [world event] world) (defn some-other-middleware [handler] (fn [world event] ... (handler world eve

[ANN] packthread 0.1.8

2015-12-14 Thread Jason Felice
Changes: * Allow fn+>'s first arg to be destructuring. packthread "Smarter" threading macros. Why? Because every time you've wanted to: (-> 42 (let [x 79] (+ x) inc) but clojure wouldn't let you. +> Thr

[ANN] avi 0.1.8

2016-01-07 Thread Jason Felice
ly. Especially to noobs. <https://github.com/maitria/avi#contributing>Contributing We track upcoming work on a Trello board <https://trello.com/b/E2LFvVLy/avi>. This board has many small things that are easy to pick up, and we'd love to see you. I (Jason Felice) would love to wa

Re: Using map inc fails on windows

2016-01-11 Thread Jason Felice
I would expect what you expect. Are you sure there's nothing in the clojure-noob.core namespace which redefines map? If not, try restarting the REPL in case map got clobbered somehow. On Mon, Jan 11, 2016 at 12:08 PM, Igwe Ogba wrote: > > >

Re: [ldnclj] Re: Suggestions for open source contributions?

2016-02-02 Thread Jason Felice
We have a lot of focus on being new-Clojurian and new-programmer friendly for Avi, including being able to spend a couple hours a week remote-pairing. I think this is a good project if the person is familiar with (or especially fond of) Vim. https://github.com/maitria/avi -Jason On Tue, Feb 2,

Re: Command Interpreter in Clojure?

2016-02-16 Thread Jason Felice
Here are some thoughts from having done similar things: 1. Don't invent a syntax, as we already have lisp. If the parens intimidate people, just inserting the outermost set for each line will get you a long way. e.g. (clojure.edn/read-string (str "(" line ")")) 2. Make a multimethod to dispatc

Re: Testing functions in threading macros (with Midje)

2016-03-03 Thread Jason Felice
People have different philosophies, but here's mine: Test your code through a very few stable interfaces. I would *not* isolation test each function. If you make small functions and you want to refactor (inline and extract duplication), isolation testing will make things difficult. If you choos

Re: Clojure beginner: IF statement error!

2016-03-04 Thread Jason Felice
Comments start with a semicolon (;). On Fri, Mar 4, 2016 at 7:23 PM, Joseph Smith wrote: > Those strings are in the if form. > > --- > Joe R. Smith > j...@uwcreations.com > @solussd > > > On Mar 4, 2016, at 6:48 PM, Renata Akhm wrote: > > Hi! I've just strated coding on Clojure and tried to mov

Re: Similar lisps and emacs reimplementations?

2016-03-19 Thread Jason Felice
I specifically know of a large corporation with a strict legal team which has rejected React's license, but accepted both the Eclipse and Apache public licenses. React's license has a similar but much broader clause with respect to patents. Sam's claim, 'I can only guess that the current use of c

Re: Porting Clojure to Native Platforms

2016-04-25 Thread Jason Felice
There was talk of an LLVM backend a while back, but I believe LLVM was deemed too low-level to be useful. That was, in fact, why I signed the contributor agreement. So, I'd love to see some movement on a C back-end. Gambit Scheme has a special form that emits C (or C++) code. It's very useful.

Re: Macro usage within Clojure community and naming functions which perform actions under certain conditions

2016-04-26 Thread Jason Felice
I wrote packthread to avoid needing threading counterparts of a bunch of control forms - it rewrites threading through control forms. https://github.com/maitria/packthread It doesn't (yet) solve when you need the threaded value in the middle of a threading form. I've had some thoughts about thre

Re: Porting Clojure to Native Platforms

2016-04-27 Thread Jason Felice
On Tue, Apr 26, 2016 at 7:42 PM, Plínio Balduino wrote: > > * Is there a way to compile C++ code at runtime? This would be essential > for the REPL and for Macros. > - I never heard about on demand native code generation and execution. I > think it could be a paradise for viruses, but I know alm

Re: Unum in Clojure/ClojureScript?

2016-05-03 Thread Jason Felice
Just to point out, the OP claimed the number format has no rounding or precision problems, which is not possible. Think about ways to represent pi for a bit! -Jason On Tue, May 3, 2016 at 5:51 PM, James Elliott wrote: > Heh! I just read about these in an email from ACM, and found your post by

Re: understanding a clojuredocs merge example

2016-05-13 Thread Jason Felice
(def baz (partial merge {:opt1 "default-1" :opt2 "default-2"})) :) On Thu, May 12, 2016 at 5:08 PM, hiskennyness wrote: > > > On Thursday, May 12, 2016 at 9:33:29 AM UTC-4, Michael Willis wrote: >> >> As long as we're cutting out unnecessary code, this is also equivalent: >> >> (defn baz [optio

Re: Is java.lang.Class not a dependable map key?

2016-05-18 Thread Jason Felice
When you reload a namespace with a record, the class for that record gets recreated. It will be functionally equivalent, but a different object. I'll bet that classes hash on identity. (Though if they hashed on name, you'd still have this problem.) On Wed, May 18, 2016 at 1:31 PM, JvJ wrote: >

Re: Is java.lang.Class not a dependable map key?

2016-05-18 Thread Jason Felice
he library I'm making to be built around a > repl-oriented workflow (like every good clojure library should). > > Is there any way around this, or do I have to resort to :type metadata? > > On Wednesday, 18 May 2016 11:07:37 UTC-7, Jason Felice wrote: >> >> When you

Re: Refactoring as an nREPL middleware

2014-02-07 Thread Jason Felice
I think this is an awesome idea. I think it should be easy to build on top of vim-fireplace to integrate with vim, and I will surely beta test for you. On Feb 7, 2014 4:51 PM, "Curtis Gagliardi" wrote: > Hey everyone, I just wanted to get some feedback on whether or not this is > a good idea. I

[ANN] avi: A lively vi. 0.1.0

2014-03-01 Thread Jason Felice
>From https://github.com/maitria/avi Avi is a vi written in Clojure. It's currently very basic and read-only, but has solved the hardest problems first (JNI terminal writing, installation, booting the JVM). It currently supports h,j,k,l,^E,^Y,$,^,0,G,:q and command repeat counts. *Vision* A li

Re: [ANN] avi: A lively vi. 0.1.0

2014-03-03 Thread Jason Felice
inux. > > > On Sunday, March 2, 2014 12:25:50 PM UTC+8, Jason Felice wrote: >> >> From https://github.com/maitria/avi >> >> Avi is a vi written in Clojure. It's currently very basic and read-only, >> but has solved the hardest problems first (JNI ter

Re: How to replace code inside a macro

2014-03-04 Thread Jason Felice
Can you use macrolet from here: https://github.com/clojure/tools.macro ? On Tue, Mar 4, 2014 at 11:30 AM, milinda wrote: > I wanted to achive following inside a macro. Lets say I have a macro > called deffilter which can use in following manner. > > (deffilter split-sentence ["sentence"] ["word"

Re: Accumulate results without state?

2014-03-04 Thread Jason Felice
Something like (with-open [rdr (clojure.java.io/reader "/dev/errors-sunday.csv")] (->> (line-seq rdr) (filter #(re-matches #"...")) (map #(nth (string/split % #",") 1 Will do what you want. It's laziness to the rescue. On Tue, Mar 4, 2014 at 3:21 PM, Dean Laskin wrote:

Re: Accumulate results without state?

2014-03-04 Thread Jason Felice
, Mar 4, 2014 at 4:07 PM, Dean Laskin wrote: > Awesome, thanks Jason! It looks much cleaner. > > Dean > > > On Tuesday, March 4, 2014 4:47:12 PM UTC-5, Jason Felice wrote: > >> Something like >> >> (with-open [rdr (clojure.java.io/reader "/dev/

Re: Calling from a macro to a private macro

2014-03-18 Thread Jason Felice
I think you're missing an important part: We're saying that you can take your third, private helper macro, and turn it into a private helper function. If you invoke it at compile time from the public macros, it will receive the unevaluated forms you want, and be able to transform the unevaluated

Re: Finding maximum weighted graph matchings

2014-03-18 Thread Jason Felice
I thought matching was a dual of max flow, so weighted matching was a dual of min cost max flow (relabling edges with infinity minus cost). The simplest algorithm to implement would be Ford-Fulkerson with Floyd-Warshall to find augmenting paths. The most efficient would be Dinic's, I think? O

Re: Clojure + BDD + TDD + Pairing...

2014-03-25 Thread Jason Felice
I do TDD, even with my clojure (combined with repl-driven development). BDD, however, doesn't make a lot of sense in clojure-land. If logic is kept to pure functions as much as possible and state management kept to the "outside" of the app (highly recommended), TDD becomes really fun and managabl

[ANN] avi 0.1.3

2014-03-28 Thread Jason Felice
*0.1.3 - The "view" Release* Avi should now make an acceptable replacement for the "view" command. - Clojure 1.6.0 - Implemented ^D, ^U, L, H, M, gg - Implementing new normal mode commands is now much cleaner. avi A lively vi. Vision We love vim

Re: Compile time binding for macros

2014-04-02 Thread Jason Felice
Better is subjective, but you could use macrolet from https://github.com/clojure/tools.macro . On Wed, Apr 2, 2014 at 9:14 PM, Gal Dolber wrote: > Is there a better way to achieve this? > > https://gist.github.com/galdolber/9946533 > > Thanks! > > -- > You received this message because you are

Re: Thoughts on a curly-infix reader macro?

2014-04-04 Thread Jason Felice
Odd-entry-count maps would have corner cases: One would need to use an even number of unary operators. If an odd number of unary operators were used, what looked like a valid expression would become a map, and that might be hard to figure out. Also, since the order of entries in a map is not guar

Re: alternative syntax for Clojure? Haskell?

2014-04-05 Thread Jason Felice
In the original post: > I had been writing elegant but deeply nested Clojure code that was very difficult to read ... I focus on expressivity, specifically because of the write-only phenomenom. This isn't peculiar to clojure; this happened a lot in the Perl days (so much so, that that's where I

Re: Proposing a new Clojure documentation system (in Clojure)

2014-04-26 Thread Jason Felice
Personally, I like documentation in the same place as the code it documents And I'd love to have the tests in the same file as well. In both cases, I think the things are highly coupled by their nature, and therefore I want them together (OK, tests aren't always - in the cases they aren't, pu

[ANN] packthread 0.1.0

2014-04-30 Thread Jason Felice
packthread Threading macros for working with globs of state. Why? Many descriptions about state in Clojure fit into the following form: State is hard to reason about, and so we use pure functions in Clojure. But then we have a prob

Re: [ANN] packthread 0.1.0

2014-05-03 Thread Jason Felice
Hi! I'm pretty familiar with legal license stuff (though IANAL). I wouldn't mind considering changing it at the point where someone wants to use it but can't - because that would carry with it a specific reason we can think about. -Jason On Fri, May 2, 2014 at 3:03 PM, James Reeves wrote: >

Re: [ANN] packthread 0.1.0

2014-05-05 Thread Jason Felice
I've never seen synthread. I'll investigate in probably a few days. On Sat, May 3, 2014 at 9:52 AM, Jozef Wagner wrote: > Thanks for releasing this library. How does it compare to the synthread > library [1] [2] ? Seems like both libraries have the same goal. > > Jozef > > [1] https://github.c

Re: Problem when trying to import SAT4J java class

2014-05-05 Thread Jason Felice
The form should be: (:import [org.sat4j.core Vec]) ; note the square braces. On Mon, May 5, 2014 at 3:29 PM, Ronan BARZIC wrote: > Hi, > > I'm trying to use the SAT4J java library (http://www.sat4j.org) from > Clojure. > I've create a clojure app with "lein new app sat4j-app" > > I've edited t

Re: [ANN] Automat: better FSMs through combinators

2014-05-14 Thread Jason Felice
Wow, this library looks very useful! Thanks! -Jason On Tue, May 13, 2014 at 5:55 PM, Colin Fleming wrote: > I'm also very excited about Automat, although I haven't had time to look > at it closely yet. Ragel is one of my favourite pieces of software. Here's > an article from Zed Shaw about usin

Re: Are zippers the right choice for "sequence-like" trees?

2014-06-04 Thread Jason Felice
In general, I've found that zippers make complicated edits super-easy, while a recursive phrasing of the same algorithm - if it exists and isn't super complicated to write - performs better and gives more control over structural sharing. I might prove out an algorithm with zippers, but when the pe

[ANN] Avi 0.1.4

2014-06-05 Thread Jason Felice
https://github.com/maitria/avi/blob/master/README.md#contributing> Contributing We track upcoming work on a Trello board <https://trello.com/b/E2LFvVLy/avi>. This board has many small things that are easy to pick up, and we'd love to see you. I (Jason Felice) would love to walk thro

[ANN] packthread 0.1.2

2014-06-10 Thread Jason Felice
*New: *+> and +>> will now thread through try and catch, and leave finally alone. packthread Threading macros for working with globs of state. Why? Many descriptions about state in Clojure fit into the following form: State is har

Re: How to organize clojure functions? A clojure newbie here...

2014-02-03 Thread Jason Felice
Hi Aravindh! I've found the leiningen source very clean and well organized. It was one of the first production products that I read through, and it has the benefit that you're probably familiar with what it does and will probably want to extend or configure it. On Mon, Feb 3, 2014 at 2:47 AM, A