[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 code, and an additional format
method is available for list values in nREPL replies.

rep

https://github.com/eraserhd/rep

A single-shot nREPL client designed for shell invocation.

This connects to a running nREPL server (like kind started with lein repl,
for example), sends some code to be evaluated, and prints the results and
output.

$ rep '(clojure.tools.namespace.repl/refresh)'
:reloading ()
:ok

Unlike other nREPL clients, rep does not try to maintain a persistent
connection, meaning that thread-local variables and bindings like *e
and *1 will
not persist across invocations of rep. Perhaps there are other limitations
because of this?
Installation

$ make && sudo make install

Usage, Options,
and Examples

See the rep manpage
.
Building with Nix

You can use Nix  as the build tool.

$ nix-build .

A result symlink will appear in the current directory point to the build
output.
Running Tests

To run all the tests that CI runs, the way CI runs them (do this before
issuing a pull request):

$ nix-build release.nix

Using with Kakoune

The rc/ folder contains scripts which add a ,e user mode to Kakoune. To
link this to Kakoune’s autoload directory, do the following:

$ make && make install
$ ln -sf /usr/local/share/kak/autoload/plugins/rep.kak ~/.config/kak/autoload/

rep must be in the path for the plugin to work.
License

Copyright © 2018 Jason M. Felice

Distributed under the Eclipse Public License either version 1.0 or (at your
option) any later version.

-- 
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/CAB6_Sob-UEmO3MtCCgD%2BhCm_6OAYOZALN5hfhKQ7Gv7qgAK3AQ%40mail.gmail.com.


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
> Functional Programming Workshop*. The deadline has been extended to *May
> 31*. Please also note that the workshop is now to be held *virtual*ly;
> hopefully the silver lining is more and wider participation. We look
> forward to your submissions.
>
>
> *Call for Papers*The 2020 Scheme and Functional Programming Workshop is
> calling for submissions.
>
> We invite high-quality papers about novel research results, lessons
> learned from practical experience in industrial or educational setting, and
> even new insights on old ideas. We welcome and encourage submissions that
> apply to any language that can be considered Scheme: from strict subsets of
> RnRS to other “Scheme” implementations, to Racket, to Lisp dialects
> including Clojure, Emacs Lisp, Common Lisp, to functional languages with
> continuations and/or macros (or extended to have them) such as Dylan,
> ECMAScript, Hop, Lua, Scala, Rust, etc. The elegance of the paper and the
> relevance of its topic to the interests of Schemers will matter more than
> the surface syntax of the examples used. Topics of interest include (but
> are not limited to):
>
> Interaction: program-development environments, debugging, testing,
> refactoring
> Implementation: interpreters, compilers, tools, garbage collectors,
> benchmarks
> Extension: macros, hygiene, domain-specific languages, reflection, and how
> such extension affects interaction.
> Expression: control, modularity, ad hoc and parametric polymorphism,
> types, aspects, ownership models, concurrency, distribution, parallelism,
> non-determinism, probabilism, and other programming paradigms
> Integration: build tools, deployment, interoperation with other languages
> and systems
> Formal semantics: Theory, analyses and transformations, partial evaluation
> Human Factors: Past, present and future history, evolution and sociology
> of the language Scheme, its standard and its dialects
> Education: approaches, experiences, curricula
> Applications: industrial uses of Scheme
> Scheme pearls: elegant, instructive uses of Scheme
>
>
> *Important dates*Submission deadline is 31 May 2020.
> Authors will be notified by 12 June 2020.
> Camera-ready versions are due 30 June 2020.
> All deadlines are (23:59 UTC-12), “Anywhere on Earth”.
> Submission Information
> Paper submissions must use the format acmart and its sub-format acmlarge.
> They must be in PDF, printable in black and white on US Letter size.
> Microsoft Word and LaTeX templates for this format are available at:
>
> http://www.sigplan.org/Resources/Author/
>
> 
> This format is in line with ACM conferences (such as ICFP with which we
> are colocated). It is recommended to use the review option when submitting
> a paper; this option enables line numbers for easy reference in reviews.
>
> We want to encourage all kinds of submissions, including full papers,
> experience reports and lightning talks. Papers and experience reports are
> limited to 14 pages, but we encourage submitting smaller papers. Lightning
> talks are limited to 192 words. Each accepted paper and report will be
> presented by its authors in a 25 minute slot including Q Each accepted
> lightning talk will be presented by its authors in a 5 minute slot,
> followed by 5 minutes of Q
>
> The size limits above exclude references and any optional appendices.
> There are no size limits on appendices, but the papers should stand without
> the need to read them, and reviewers are not required to read them.
>
> Authors are encouraged to publish any code associated to their papers
> under an open source license, so that reviewers may try the code and verify
> the claims.
>
> Proceedings will be printed as a Technical Report at the University of
> Michigan and uploaded to arXiv.org
> 
> .
>
> Publication of a paper at this workshop is not intended to replace
> conference or journal publication, and does not preclude re-publication of
> a more complete or finished version of the paper at some later conference
> or in a journal.
>
> Sincerely,
>
>
> Jason Hemann, Northeastern University
>
>
>
>
>
> *Organizing Committee*Michael D. Adams (Program Co-Chair), University of
> Michigan
> Baptiste Saleil (Program Co-Chair), IBM Canada
> Jason Hemann (Publicity Chair), Northeastern University
>
>
>
> *Program Committee*Michael D. Adams (Program Co-Chair), University of
> Michigan
> 

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 the name.  Virtual methods (ones which can be overridden) are
collected into what is effectively a map attached to the instance.

On Tue, Mar 31, 2020 at 4:41 AM Dieter Van Eessen <
dieter.van.ees...@gmail.com> wrote:

> Hello,
>
> I've got a clojure and a python piece of code. Both seem to create what
> can be considered an instance of a class. Wherein lies the conceptual
> difference?
>
> Python:
> class MYCLASS():
> def __init__(self, x):
>   self.x = x
> def MYMETHOD(self):
>  ...
>
> def MYFUNCTION():
> lol = MYCLASS()
>
> Clojure:
> (defn MYCLASS [x]
>  {:x [x]
>   :MYMETHOD (fn [] (MYCLASS ...))})
>
> (let [lol (MYCLASS ...)])
>
> I know its not valid code, but I hope you see what I'm aiming at: isn't
> using a map with functions in it just the same as a class?
> Or is only the user interface of the language conceptually equal, while
> the underlying plumbing is completely different?
> If this is the case, wherein lies the major differences?
>
> If one could simply point me in the right direction, I'd already be very
> pleased. Most literature I've read so far only explains clojure can be used
> this way, but never focuses deeper on the subject.
>
> kind regards,
> Dieter
>
> --
> 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/49cd26ca-48ae-48b4-a5ab-b0f7c711b77e%40googlegroups.com
> 
> .
>

-- 
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/CAB6_SoYCTeKi2teO%3DbgyEB-Vu3C-fCGpX6T%3DXZB8ApmDP-c8vA%40mail.gmail.com.


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 way (at least not
a portable one) to get a file descriptor for a user space object.



On Fri, Feb 14, 2020 at 5:40 AM Sonny To  wrote:

> here is an example of
>
>
>
>
>
>> package foo;
>>
>>
>>
>> import com.sun.jna.Library;
>>
>>
>> import com.sun.jna.Native;
>>
>>
>> import com.sun.jna.Pointer;
>>
>>
>>
>>
>>
>> public interface C extends Library {
>>
>>
>> C INSTANCE = (C) Native.load("c",C.class);
>>
>>
>>
>>
>>
>> void printf(String format, Object... args);
>>
>>
>> }
>>
>>
>
>
>
> calling this from a java main like this works as expected at the command
> line
>   C.INSTANCE.printf("hello\n");
>
> but from the clojure REPL,
>
> (.printf foo.C/INSTANCE "hello "(into-array []))
>
>
> does not show anything
>
> On Friday, February 14, 2020 at 6:30:51 PM UTC+8, Sonny To wrote:
>>
>> I am using JNA to call native C code. calling native code that outputs to
>> stdout does not show up in the Clojure REPL. stdout is redirected somewhere
>> that is not attached to *out*
>>
>> How can I get stdout from native code outputting to *out* in the REPL?
>> Without this, it makes it difficult to see what went wrong in the C code.
>>
>> thanks,
>> Sonny
>>
> --
> 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/bd950525-defd-4696-948e-ac321dc5220e%40googlegroups.com
> 
> .
>

-- 
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/CAB6_SoZouGg9vWxwHK92QpSPnLW%2Bz4gROyGKm6mR9W5%3DF-_Hkg%40mail.gmail.com.


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 that must agree with each other, then
I'd look to create a sublanguage for the config that makes it harder to
specify incorrect things, and that's when I might use symbols.  That
depends on how the language looks, mostly.

That said, I have a place in my config where I use symbols as map keys
because it is specifying GraphQL attribute names, and other non-Clojure
developers edit it.

-- 
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/CAB6_SoanVGAW2jhZNY0NS9XFGap6q5r7HHSgsRN99EoZ2ehCDw%40mail.gmail.com.


[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
. This repo comes with Vim plugin
files that work with Vim8 and Neovim. The Rust library can be called from
other editors that can load dynamic libraries.

This plugin, unlike others available for Vim, implements "smart" mode.
Rather than switching between "paren" mode and "indent" mode, parinfer uses
information about how the user is changing the file to decide what to do.
Installing

Dependencies:

   -

   rust  >= 1.36
   -

   libclang, which may be part of a clang package, depending on your OS

Vim and Neovim
pathogen

If you are using Tim Pope’s pathogen:

$ cd ~/.vim/bundle
$ git clone g...@github.com:eraserhd/parinfer-rust.git
$ cd ~/.vim/bundle/parinfer-rust
$ cargo build --release

vim-plug

Plug 'eraserhd/parinfer-rust'

Then, build project using cargo:

$ cd /path/to/parinfer-rust
$ cargo build --release

Or, with optional automatic recompilation on update:

Plug 'eraserhd/parinfer-rust', {'do':
\  'cargo build --release'}

Kakoune
plug.kak

Add this to your kakrc

plug "eraserhd/parinfer-rust" do %{
cargo build --release
cargo install --force --path .
}

Re-source your kakrc or restart Kakoune. Then run :plug-install. plug.kak will
download, build and install plugin for you.
Manual

$ cd ~/my-projects
$ git clone g...@github.com:eraserhd/parinfer-rust.git
$ cd parinfer-rust
$ make install
$ cargo build --release
$ cargo install

Emacs

To install parinfer-rust for Emacs follow the instructions at
parinfer-rust-mode.el

Building
WebAssembly

WebAssembly currently needs the ``nigthly'' toolchain:

$ rustup update
$ rustup install nightly
$ rustup target add wasm32-unknown-unknown --toolchain nightly
$ cargo +nightly install cargo-web

It can then be built with:

$ cargo +nightly web build --release

Tests

You can run tests like so:

$ cargo test   # Run the native tests
$ cargo +nightly web test  # Test the WebAssembly version
$ vim --clean -u tests/run.vim # Integration tests

Tests are in a nice, readable format in tests/test_*.vim. Please add tests
for any new features (or even old ones!). You can set the VIM_TO_TEST
environment
variable to Vim’s path to test weird or different builds.
Contributors

This wouldn’t be possible without the work of others:

   -

   Shaun Lebron - Inventing parinfer and doing the math.
   -

   Case Nelson - Writing the nvim-parinfer, from which VimL code and some
   inspiration was stolen.
   -

   Justin Barclay - Emacs module.

License

ISC License


-- 
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/CAB6_SoYsMKDgD7qRopH6o7szi-9EirLMxJmFk85WgkC%3D%3D3JEDg%40mail.gmail.com.


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
> demonstrated in my 2017 Clojure Conj talk how it can be used to solve an
> assortment of puzzles (https://youtu.be/TA9DBG8x-ys) and some of you may
> have played around with the library after that talk.
>
> I've recently made a number of improvements and refinements, and
> completely overhauled the README. Those of you with an interest in puzzles
> and/or constraint programming may enjoy reading through the README and
> getting a feel for how this library can be applied to certain classes of
> constraint problems.
>
> Tarantella is also a great case study in the combination of speed and
> expressiveness you can get by writing a Clojure API for a lower-level
> implementation written in Java.
>
> https://github.com/Engelberg/tarantella
>
> --
> 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/CAORbMOPOPRZ%3DeJOWT3AKrzrfLTxq%2B4rOrGDpH5DxHLAOB0gxkQ%40mail.gmail.com
> 
> .
>

-- 
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/CAB6_SoZqB2HSzZ22Q3aJf0qjQLs8Zv0uxgHdbRJk8vcrOqzz_A%40mail.gmail.com.


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


[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 something smart - either finding
successive objects or successively larger objects, depending on what makes
sense in the context.
Demo
[image: 235120] 
Figure 1. Selecting elements
[image: 235116] 
Figure 2. Selecting forms
[image: 235118] 
Figure 3. Selecting toplevels



-- 
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: [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 native-image, which improves boot time considerably, which is
important for editor responsiveness:

[jfelice@C02X421DJHD4 src]$ time for ((i = 0; i < 100; i++)); do rep '(+ 2
2)' >/dev/null; done

real0m2.323s
user0m0.875s
sys 0m0.872s
[jfelice@C02X421DJHD4 src]$ time for ((i = 0; i < 100; i++)); do clj -e '(+
2 2)' >/dev/null; done

real1m32.994s
user2m37.918s
sys 0m14.129s
[jfelice@C02X421DJHD4 src]$


-Jason

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


[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 connects to a running nREPL server (like kind started with lein repl,
for example), sends some code to be evaluated, and prints the results and
output.

$ rep '(clojure.tools.namespace.repl/refresh)'
:reloading ()
:ok

Unlike other nREPL clients, rep does not try to maintain a persistent
connection, meaning that thread-local variables and bindings like *e
and *1 will
not persist across invocations of rep.

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


[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 might
   invoke rep

rep

https://github.com/eraserhd/rep

A single-shot nREPL client designed for shell invocation.

This connects to a running nREPL server (like kind started with lein repl,
for example), sends some code to be evaluated, and prints the results and
output.

$ rep '(clojure.tools.namespace.repl/refresh)'
:reloading ()
:ok

Unlike other nREPL clients, rep does not try to maintain a persistent
connection, meaning that thread-local variables and bindings like *e
and *1 will
not persist across invocations of rep. Perhaps there are other limitations
because of this?

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


[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
running server.

It connects to a running nREPL server (like kind started with lein repl,
for example), sends some code to be evaluated, and prints the results and
output.

$ rep '(clojure.tools.namespace.repl/refresh)'
:reloading ()
:ok

-- 
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: [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 extension provides that is not
>> already possible with direct definitions or external extensions. Some
>> additional background or a small motivating example would be much
>> appreciated in clearing up the confusion!
>>
>
> Metadata extension allows you to implement protocols on a per-value basis
> (the others are type/class-oriented). This opens up a whole new range of
> potential uses for protocols. Rich was already using this approach for the
> new datafy/nav functionality - this made it generic for all protocols.
>
> Any collection instance can carry metadata, so you can take any collection
> instance and dynamically extend a protocol to it by adding metadata. So if
> you think about something like Component, which has a Lifecycle protocol
> for start/stop, you can now make lightweight components without needing to
> make a type or reify:
>
> $ clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0-beta5"},
> com.stuartsierra/component {:mvn/version "0.3.2"}}}'
> Clojure 1.10.0-beta5
> user=> (require '[com.stuartsierra.component :as component])
> nil
> user=> (def c (with-meta {:state :init}
> {`component/start (fn [c] (assoc c :state :started))
>  `component/stop (fn [c] (assoc c :state :stopped))}))
> #'user/c
> user=> (component/start c)
> {:state :started}
> user=> (component/stop c)
> {:state :stopped}
>
>
> --
> 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.


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 wondering if there is an easy way I can pipe my shell output into a
> REPL. Something like:
>
> cat /tmp/remus-lighthouse-apis-info.ion | lein repl
>
> When I try this, it starts a REPL, and then each line gets sent one by one
> to the REPL and ran.
>
> I'd like it so that I'm at the REPL, and standard in is ready to be read
> by me, from the REPL, so I can manipulate the input being piped how I see
> fit within the repl session.
>
> Is there anyway to do this?
>
> --
> 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.


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
> 
> (SPY QuieTly), useful for preventing large outputs from drowning your REPL.
> - (sc.api/calling-from ...) and :sc/called-from
> :
> only log / record an Execution Point when invoked from some upstream
> caller. Useful for spy-ing inside generic functions which get called a lot
> when you trigger execution.
>
> Feedback welcome !
>
> Valentin Waeselynck
>
> --
> 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.


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
> -- I almost didn't
> read it.  But, it's really a Serverless offering, which makes a lot of
> sense and is a pretty monumental move.
>
> I look forward to trying it out.
>
> marc
>
>
> On Wed, Jun 6, 2018 at 3:48 PM, Alex Miller  wrote:
>
>> Datomic Ions let you develop applications for the cloud by deploying your
>> code to a running Datomic cluster. You can *focus on your application
>> logic*, writing ordinary Clojure functions, and the ion tooling and
>> infrastructure handles the deployment and execution details. You can
>> leverage your code both inside Datomic transactions and queries, and from
>> the world at large via built-in support for AWS Lambda.
>>
>> With Datomic Ions you can:
>>
>>- Focus on your application
>>- Leverage your Datomic Cloud cluster compute resources and data
>>locality
>>- Extend Datomic transactions and queries with your own logic
>>- Connect to the broader AWS cloud via Lambda events
>>- Service web consumers with API Gateway
>>- Scale Datomic and your app together
>>- Deliver on AWS with high agility
>>
>>
>> To learn more about ions, check out the Datomic Cloud Ions documentation
>> at https://docs.datomic.com/cloud/ions/ions.html
>>
>> --
>> 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.


[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. This repo comes with Vim
plugin files that work with Vim8 and Neovim. The Rust library can be called
from other editors that can load dynamic libraries.

This plugin, unlike others available for Vim, implements "smart" mode.
Rather than switching between "paren" mode and "indent" mode, parinfer uses
information about how the user is changing the file to decide what to do.
Installing

You need to have rust installed
.

If you are using Tim Pope's pathogen:

$ cd ~/.vim/bundle
$ git clone g...@github.com:eraserhd/parinfer-rust
$ cd ~/.vim/bundle/parinfer-rust/cparinfer
$ cargo build --release

If you are using vim-plug:

Plug 'eraserhd/parinfer-rust'

Then, build project using cargo:

$ cd /path/to/parinfer-rust/cparinfer
$ cargo build --release

Or, with optional automatic recompilation on update:

Plug 'eraserhd/parinfer-rust', {'do':
\  'cargo build --manifest-path=cparinfer/Cargo.toml --release'}

Tests

You can run tests like so:

$ vim --clean -u tests/run.vim

Tests are in a nice, readable format in tests/test_*.vim. Please add tests
for any new features (or even old ones!). You can set the VIM_TO_TEST
environment
variable to Vim's path to test weird or different builds.
Contributors

This wouldn't be possible without the work of others:

   - Shaun Lebron - Inventing parinfer and doing the math.
   - Case Nelson - Writing the nvim-parinfer, from which VimL code and some
   inspiration was stolen.

License

ISC License


-- 
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: 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 Clojure, it's a good idea to make sure any
effects are in functions.

-Jason

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


[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't let you.
+>

Threads value through forms in much the same way as ->, except for special
handling of the following forms:
if,
if-not, if-let, if-some, when, when-let, when-not, when-some

The value is threaded through the *then* and *else* clauses independently,
leaving the test conditions alone. If an else clause is missing, it is will
be supplied as though the value had been threaded through identity.

For example,

(+> 42 (if true inc)) ;=> 43
(+> 42 (if false inc)) ;=> 42

In when, when-let, when-not, and when-some forms, the value is threaded
through every form in the body, not just the last.
case

The values being compared are left untouched and the value is threaded
through the expr clause of each condition.

For example,

(+> 42
  (case 1
1 inc
2 dec)) ;=> 43

(+> 42
  (case 2
1 inc
2 dec)) ;=> 41

cond

The test clauses are left untouched and the value is threaded through the
expr clauses of each condition. If there's no :else condition, +> pretends
it was (identity).

For example,

(+> 42
  (cond
(= 1 2)
inc)) ;=> 42

(+> 42
  (cond
(= 1 1)
dec)) ;=> 41

do

The current expr is threaded through the body forms of the do.
let

The current expression is threaded through the body of the let form, with
the bindings in place. For example:

(+> 42
  (let [x 1]
(+ x))) ;=> 43

try

The current expression is threaded through the body of the try form. The
*same* value is threaded through each catchclause and any finally clause.

(+> 42 (try
 inc
 (catch Exception e
   dec)) ;=> 43

(+> 42 (try
 (+ :foo)
 (catch Exception e
   dec))) ;=> 41

(+> 42 (try
 inc
 (finally dec))) ;=> 42

in

Threads inner expressions through a lens

 of value.

lens is a function with two arities - 1 and 2. The 1-arity body is the
"get" function, while the 2-arity body is the "putback" function. "get"
lifts the value into the new context, while "putback" translates the value
back to the original context.

For example,

(+> 42
(in (fn
  ([v] (/ v 2))
  ([v u] (* u 2)))
  inc)) ;=> 85/2

This can be thought of as 'lifting' the body expressions into the 'world
where things are half as large'.

As a special case, if lens is a keyword, in assumes that value is a map and
that sub-key are threaded through the inner expressions.

For example,

(+> {:hello 42}
(in :hello
  (+ 5))) ;=> {:hello 47}

This macro can only be used inside +> or +>>.
+>>

Threads expressions like ->>, except with the handling of the special forms
above.
fn+>

Like fn, except threads the function's first argument through the body
using +> . The parameter vector can be omitted, in which case the resulting
function takes one parameter.

((fn+> [x y] (+ x)) 7 3) ;=> 14
((fn+> inc inc) 42) ;=> 44

Installing

Leiningen  dependency information:

[com.maitria/packthread "0.1.10"]

Usage

(require '[packthread.core :refer :all])

(+> 42
(if true
  inc)) ;=> 43

See core_test.clj

 for examples of usage.
License

Copyright 2014 Maitria

You have permission to use this in any way you like (modify it, sell it,
republish it), provided you agree to all the following conditions:

   - you don't mislead anyone about it
   - you don't interfere with our ability to use it
   - you release us from any claims of liability if it causes problems for
   you

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

[ANN] specter-edn 0.1.4

2017-07-17 Thread Jason Felice
Thanks again to Marcelo!

Various bugfixes to handling of derefs, non-printable nodes, anonymous
functions, metadata, and key order in maps.

specter-edn

https://github.com/maitria/specter-edn/

Format-preserving Specter path for EDN and Cloure code.

There is one specter path: SEXPRS. This navigates to a sequence of
s-expressions parsed from a string.

For the transform case, specter-edn preserves whitespace and comments using
a sort of diffing algorithm to match new S-expression parts to original
parts of the parse tree.
<https://github.com/maitria/specter-edn#usage>Usage

(use 'com.rpl.specter)
(use 'com.rpl.specter.macros)
(use 'specter-edn.core)

(select [SEXPRS FIRST LAST] "[42 26 77]");=> 77

(setval [SEXPRS FIRST FIRST] 99 "[42 ; Hi mom!\n6]");=> "[99 ; Hi mom!\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/specter-edn#license>License

Copyright © 2016, 2017 Jason M. Felice

Distributed under the Eclipse Public License either version 1.0 or (at your
option) any later version.

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


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

2017-05-30 Thread Jason Felice
More thanks to Marcelo!:

   - Fix for nils in collections
   - Fix for rebuilding of maps
   - Ensure whitespace between adjacent tokens after a transform

Also, the code in the README has been corrected.

specter-edn

https://github.com/maitria/specter-edn/

Format-preserving Specter path for EDN and Cloure code.

There is one specter path: SEXPRS. This navigates to a sequence of
s-expressions parsed from a string.

For the transform case, specter-edn preserves whitespace and comments using
a sort of diffing algorithm to match new S-expression parts to original
parts of the parse tree.
<https://github.com/maitria/specter-edn#usage>Usage

(use 'com.rpl.specter)
(use 'com.rpl.specter.macros)
(use 'specter-edn.core)

(select [SEXPRS FIRST LAST] "[42 26 77]");=> 77

(setval [SEXPRS FIRST FIRST] 99 "[42 ; Hi mom!\n6]");=> "[99 ; Hi mom!\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/specter-edn#license>License

Copyright © 2016, 2017 Jason M. Felice

Distributed under the Eclipse Public License either version 1.0 or (at your
option) any later version.

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


[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 whitespace and comments using
a sort of diffing algorithm to match new S-expression parts to original
parts of the parse tree.
Usage

(use 'com.rpl.specter)
(use 'com.rpl.specter.macros)
(use 'com.maitria.specter-edn)

(select [SEXPR FIRST LAST] "[42 26 77]");=> 77

(setval [SEXPR FIRST FIRST] 99 "[42 ; Hi mom!\n6]");=> "[99 ; Hi mom!\n6]"

TODO

   - Use clj-format to format new code which isn't matched up with old code.

License

Copyright © 2016 FIXME

Distributed under the Eclipse Public License either version 1.0 or (at your
option) any later version.

-- 
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: 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 will be a lot of repeats.

(There is also a feature where it starts "small" and grows.  This means
that repeated examples are more likely at first.)

I would definitely recommend unit testing if the state space is small
enough to enumerate and fit in your head.

-Jason

On Mon, Apr 3, 2017 at 5:31 AM, Didier  wrote:

> Do you know why they are not unique? Was that on purpose or an accidental
> behaviour of the implementation?
>
> --
> 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.


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"  wrote:
> >>
> >
> > Since you're responding to me specifically, I'd like to be clear that I
> never made that claim. I only said we need more experimentation. This is a
> sufficiently big enough area of ideas to warrant exploration of competing
> approaches.
>
> My comment wasn't intended as directed specifically at you.  Your list of
> references was interesting and useful.  Thanks for posting them.
>
> --
> 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.


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 static for, say, 30 seconds, they we can assume they're complete.
>
> That was my first thought. Then I thought someone had perhaps already done
> this in a library. But perhaps the code is to trivial to bundle up into a
> library? I suppose this is the route that I'll take, though it seems
> inexact.
>
>
>
>
>
> On Sunday, December 11, 2016 at 5:05:52 PM UTC-5, James Reeves wrote:
>>
>> Checking whether a file is being written to tends to be very platform
>> specific. I don't think that there's any Java library that manages it
>> perfectly, but I could be wrong.
>>
>> My inclination would be to watch for files in a directory, then poll
>> their filesize. If it remains static for, say, 30 seconds, they we can
>> assume they're complete.
>>
>> Alternatively, you could build a simple web app with a drag and drop file
>> API. Users open the webpage, drag the Excel files to it, and you can then
>> control the upload and processing directly, even providing feedback.
>>
>> - James
>>
>> On 11 December 2016 at 19:47, larry google groups 
>> wrote:
>>
>>>
>>> I'm in a situation where we allow staff to upload Microsoft Excel files
>>> to our servers, which we then parse and store the data in DynamoDB.
>>>
>>> I've only used file watchers once before, to watch for any change in a
>>> directory. These seemed to trigger when a file was created in a directory
>>> -- I recall I then tried to read from such files, but I got an error
>>> because the file was still being written. I'm curious if there are file
>>> watchers that I can have trigger when a file is fully uploaded, or fully
>>> copied?
>>>
>>> My goal is to avoid the errors that occur when I try to read from a file
>>> that is still being written to.
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@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+u...@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+u...@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.


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 +1] [0 -1]]
[(+ i id) (+ j jd)]))

This creates some negligible lazy lists.

If you want to test actual time for hash inserts, though, you'll probably
need to use transients or some such, and the code would become less
idiomatic.


On Tue, Nov 15, 2016 at 10:39 PM, Didier  wrote:

> Hey all,
>
> I came upon a benchmark of F#, Rust and OCaml, where F# performs much
> faster then the other two. I decided for fun to try and port it to Clojure
> to see how Clojure does. Benchmark link: https://github.com/c-cube/
> hashset_benchs
>
> This is my code for it: https://gist.github.com/didibus/
> 1fd4c00b69d927745fbce3dcd7ca461a
>
> (ns hash-set-bench
>   "A Benchmark I modified to Clojure from:
>https://github.com/c-cube/hashset_benchs;)
>
> (defn iterNeighbors [f [i j]]
>   (f [(dec i) j])
>   (f [(inc i) j])
>   (f [i (dec j)])
>   (f [i (inc j)]))
>
> (defn nth* [n p]
>   (loop [n n s1 #{p} s2 #{}]
> (if (= n 0)
>   s1
>   (let [s0 (atom #{})]
> (letfn [(add [p]
>  (when (not (or (contains? s1 p) (contains? s2 p)))
>(reset! s0 (conj @s0 p]
>(doseq [p s1] (iterNeighbors add p))
>(recur (dec n) @s0 s1))
>
> #_(printf "result is %d" (count (time (nth* 2000 [0 0]
>
> And here's the F# code: https://github.com/c-cube/
> hashset_benchs/blob/master/neighbors2.fsx
>
> Currently, this takes about 30s in Clojure, while it only takes around 3s
> for OCaml, Rust and F#.
>
> From what I see, the differences between my code and theirs are:
>
>- Lack of a Point struct, I'm just using a vector.
>- They use a mutable set, I don't.
>- They overrode Hashing for their point struct, as well as equality. I
>rely on Clojure's default hashing, and vector equality.
>
> I'm not sure if any of these things should really impact performance that
> much though. And what I could do in Clojure if I wanted to improve it.
>
>
> Any Help?
>
>
> Thanks.
>
> --
> 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.


[ANN] Avi 0.1.9 - The Splits

2016-10-25 Thread Jason Felice
After a couple looong periods with a lot of work, and a few also long
periods of looking askance at the project with fear and being
intimidated, *splits are
here!!:*

:sp, :vsp, :e, h, j, k, l, and :q now quits one split
until there are none left.

Special thanks to *Arun S L*, who implemented:

, , , , , line and column info in the status
bar, some bug fixes.

(and also got me back in the game, thanks!)

Also this release, Avi now renders unicode characters correctly.

The next release will likely be integration with parinfer-jvm
<https://github.com/oakmac/parinfer-jvm>.


avi

A lively vi.
<https://github.com/maitria/avi#vision>Vision

We love vim. We want more! Test coverage. Flexibilty. Live REPLs!
<https://github.com/maitria/avi#guiding-principles>Guiding Principles

   - Test driven. All functionality covered by tests.
   - Don't defeat vim muscle memory.
   - Code is for people. Be expressive as hell.
   - Be friendly. Especially to noobs.

<https://github.com/maitria/avi#code-of-welcoming-conduct>Code of Welcoming
Conduct

Everybody has boundaries around who they invite into their home. To help
you decide whether you want to hang out with us, we've done our best to
describe our boundaries here in the maitria code of conduct
<http://maitria.com/coc>. It's not a bunch of legalese. It's who we are.
Please read it.
<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 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/eraserhd> - or gchat.
<https://github.com/maitria/avi#status>Status

Our intention is for the unit tests to provide friendly documention of
what's been implemented so far. To run the unit tests with verbose output,
use

$ lein midje :print-facts

<https://github.com/maitria/avi#installing>Installing

   - Works with Leiningen 2.3.4
   - On Linux, libncursesw5-dev or equivalent must be installed.

$ git clone https://github.com/maitria/avi.git
$ cd avi
$ lein install /usr/local

On Linux, you'll likely not have access to /usr/local. In that case you'll
need to use sudo lein install instead or specify a different installation
directory.
<https://github.com/maitria/avi#license>License

Copyright 2014 Maitria

You have permission to use this in any way you like (modify it, sell it,
republish it), provided you agree to all the following conditions:

   - you don't mislead anyone about it
   - you don't interfere with our ability to use it
   - you release us from any claims of liability if it causes problems for
   you

-- 
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: 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 new-b]

If `n` is used in the computation to create new-a and new-b, then `reduce`
 and `range` would be useful.

(reduce (fn [[a b] n]
...
[new-a new-b])
 [a b]
 (range n))

It might be possible to use `map-indexed` with `repeat`, also.

-Jason


On Fri, Sep 9, 2016 at 8:28 AM, Stuart Sierra 
wrote:

> loop/recur is more typical for this kind of counting loop, as it avoids
> the risk of a stack-overflow when the number of iterations is high.
>
> Also, I recommend against the [a b & [n]] argument pattern here:
> https://stuartsierra.com/2015/06/01/clojure-donts-optional-
> arguments-with-varargs
>
> –S
>
>
>
> On Friday, September 9, 2016 at 8:02:14 AM UTC-4, Joeyjoejoe wrote:
>>
>> Hi,
>>
>> I'm just stating to learn clojure, i made a first read of "clojure
>> programming" to get the big picture, and i'm starting to play with the
>> repl, trying to solve some katas. A lot of theses katas involves returning
>> the count of loop iterations. Most of the time, i end up with this kind of
>> functions:
>>
>> (defn my-function [a b & [n]]
>>  (if cond
>>(my-function new-a new-b (inc (or n 0))
>>(or n defaut-value)
>>   )
>> )
>>
>> What are the pros/cons of doing this? Are there any idiomatic ways of
>> doing this.
>>
>> Thank you
>>
> --
> 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.


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 REPL, so at the
> moment I am doing the following:
>(print (str "Defined REPL functions:\n"
>"- do-show-schemas\n"
>"- do-show-table [table]\n"
>"- do-show-tables\n"
>"- get-h2-version\n"
>"- get-random-quotes <[nr]>\n"
>)
>   )
>
> The problem with this is that every time I add or remove a function I need
> to change this print. Is there a way to generate this list? I probably lose
> the parameters, but for a long list of functions this could be handy.
>
> --
> Cecil Westerhof
>
> --
> 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.


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 year I think. And before that I
> only made one little desktop application for myself and played with some
> little stuff like Happy Numbers. There is a big chance I will get a Clojure
> project soon, so it would be good to get up to speed. Anyone an idea what a
> good project would be to contribute to? Difficult enough that I learn a lot
> of stuff fast, but simple enough that I can contribute.
>
> I worked with a lot of languages and get proficient with languages fast.
> So in the beginning it should help me to get accustomed to Clojure, but
> after that it should be challenging enough to continue. I would not like to
> come, learn and go away. ;-)
>
> --
> Cecil Westerhof
>
> --
> 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.


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 need this library.
>
> --
> 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.


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 as next operator is + or -
  [l1-expr remaining-tokens])

(defn parse-level2 ;; * and /
  ... ; calls parse-level3 repeatedly so long as next operator is * or /
  [list]
  ...
  [l2-expr remaining-tokens])

(defn parse-level3 ;; numbers
  [list]
  (if (number? list)
[(first list) (rest list)]))



On Fri, Jun 24, 2016 at 2:28 PM, Botond Balázs 
wrote:

> Hi,
>
> I'm working through Clojure for the Brave and True and there's a little
> exercise at the end of Chapter 7
> :
>
> Create an infix function that takes a list like (1 + 3 * 4 - 5) and
>> transforms it into the lists that Clojure needs in order to correctly
>> evaluate the expression using operator precedence rules.
>
>
> I ended up implementing the shunting yard algorithm
>  in Clojure to
> solve it (65 lines, many functions), but I have the suspicion that this
> exercise isn't meant to be this complicated and that I'm missing a very
> obvious and elegant solution. What do you think?
>
> Thanks,
> Botond
>
> --
> 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.


[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 parsed from a string.

For the transform case, specter-edn preserves whitespace and comments using
a sort of diffing algorithm to match new S-expression parts to original
parts of the parse tree.
Usage

(use 'com.rpl.specter)
(use 'com.rpl.specter.macros)
(use 'com.maitria.specter-edn)

(select [SEXPR FIRST LAST] "[42 26 77]");=> 77

(setval [SEXPR FIRST FIRST] 99 "[42 ; Hi mom!\n6]");=> "[99 ; Hi mom!\n6]"

TODO

   - Use clj-format to format new code which isn't matched up with old code.

License

Copyright © 2016 FIXME

Distributed under the Eclipse Public License either version 1.0 or (at your
option) any later version.

-- 
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: Is java.lang.Class not a dependable map key?

2016-05-18 Thread Jason Felice
I don't think there's a general workaround, and I'm not sure I have enough
context to know what you are doing specifically.

On Wed, May 18, 2016 at 2:28 PM, JvJ <kfjwhee...@gmail.com> wrote:

> I suspected as much.  It would be possible to mitigate the problem by not
> using the repl, but I want the 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 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 <kfjwh...@gmail.com> wrote:
>>
>>> I'm encountering a very strange error in some tests.
>>>
>>> The details are a bit complex, but I'm using type-indexed maps.
>>>
>>> So, given an object o, the map would be {(type o) o}.  When I try to
>>> lookup with the key (type o), I don't get the value, even though I can
>>> clearly see it in the map.
>>>
>>>
>>> I have a map instance called new-still in my tests, and I can clearly
>>> see that this is its value
>>>
>>> {specs.core_test.Position {:x 0, :y 0}}
>>>
>>>
>>> However, when I try to compare the first key to the Position class
>>> (which it should be), I get this:
>>>
>>>
>>> Fail in run-systems-tst
>>> expected: (= (first (keys new-still)) Position)
>>>   actual: (not (= specs.core_test.Position specs.core_test.Position))
>>>
>>>
>>>
>>> How is it that the class specs.core_test.Position is not equal to
>>> itself??
>>> Is this a bug, or just some quirk of compilation?
>>>
>>> Thanks.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To post to this group, send email to clo...@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+u...@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+u...@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.


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:

> I'm encountering a very strange error in some tests.
>
> The details are a bit complex, but I'm using type-indexed maps.
>
> So, given an object o, the map would be {(type o) o}.  When I try to
> lookup with the key (type o), I don't get the value, even though I can
> clearly see it in the map.
>
>
> I have a map instance called new-still in my tests, and I can clearly see
> that this is its value
>
> {specs.core_test.Position {:x 0, :y 0}}
>
>
> However, when I try to compare the first key to the Position class (which
> it should be), I get this:
>
>
> Fail in run-systems-tst
> expected: (= (first (keys new-still)) Position)
>   actual: (not (= specs.core_test.Position specs.core_test.Position))
>
>
>
> How is it that the class specs.core_test.Position is not equal to itself??
> Is this a bug, or just some quirk of compilation?
>
> Thanks.
>
> --
> 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.


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 [options]
>>(merge {:opt1 "default-1" :opt2 "default-2"} options))
>>
>>
> Heh-heh, I was going to point that out. And now baz is a crippled form of
> merge.
>
> Good examples are tough!
>
>
> --
> 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.


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
> searching this Group for UNUM. It looks like not yet, but perhaps we should
> do something about that?
>
> The article which excited me:
> http://ubiquity.acm.org/article.cfm?id=2913029
>
>
> On Friday, November 6, 2015 at 8:23:35 AM UTC-6, Richard Davies wrote:
>>
>> Unum is a number representation system that is a superset of IEEE
>> integers and IEEE floats which avoids many problems (especially in floating
>> point arithmetic) as it has no rounding, no overflow to infinity, no
>> underflow to zero, and is safe to parallelize.
>>
>> I was wondering if anyone has implemented or is interested in
>> implementing this in Clojure/ClojureScript (or Java/JavaScript)?
>>
>> There is an existing reference implementation written in Mathematica and
>> it appears a port has already been done to Python:
>> https://github.com/jrmuizel/pyunum
>>
>> For more details of unum see
>> https://www.youtube.com/watch?v=jN9L7TpMxeA
>>
>> https://www.crcpress.com/The-End-of-Error-Unum-Computing/Gustafson/9781482239867
>> http://arith22.gforge.inria.fr/slides/06-gustafson.pdf
>>
>>
>> --
> 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.


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 almost nothing about
> this field. Unless of course you're generating code for (your own|a)
> virtual machine, so the rules are different.
>

There is a Scheme (I can't remember which) that generates C, spawns the
compiler, links and loads a dynamic library, then invokes the code.  I'm
having a brain fart because I want to say it's Gambit but Gambit actually
has an interpreter.  Maybe it was CHICKEN?

-- 
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: 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 threading, monads, and macros
that I need to sort out (I'd rather not do something anaphoric).  But it
does avoid the combinatorial problem you are seeing when you are trying to
combine cond-> with as->.

-Jason



On Tue, Apr 26, 2016 at 3:16 AM, Ray Miller  wrote:

> On 25 April 2016 at 21:03, Rafał Cieślak  wrote:
>
>> Hi,
>>
>> I'm writing a turn-based game and one of the biggest functions is the one
>> which handles player moves. It receives the current game state (a map) and
>> the index of the cell that the player clicked on (an integer).
>>
>> It has to make a couple of decisions based on the game state. So far I
>> just used -> and cond->. The code looks more or less like this, I
>> removed a bunch of function calls for brevity.
>>
>> (-> game-state
>> ; This stuff happens on each move.
>> (reveal-cell cell-index)
>> ; And this stuff happens only under certain conditions.
>> (cond->
>>   (zero? (:surrounding-power cell))
>>   (reveal-safe-cells cell-index)))
>>
>> The code looks clear IMHO. But then I wanted to add another feature which
>> requires me to make decisions based on the updated value of game-state
>> (the one that is being threaded inside cond->).
>>
>> I thought about cond-> a bit and came to the conclusion that the reason
>> you can't access the currently threaded value is to keep you from writing
>> order-dependent statements. But in my case, I sometimes do want to write
>> order-dependent code. For example, I want to give player exp for killing a
>> monster and then if the exp is above certain threshold, I want to level up
>> his character.
>>
>> So the problem is that I have to check the current value being threaded,
>> but cond-> doesn't allow me to do that.
>>
>>
> You don't need a macro for this sort of thing, and can get some way with
> reduce. For example:
>
> (defn apply-conditional-actions
>   [game-state & pred-actions]
>   (reduce (fn [game-state [pred action]]
> (if (pred game-state)
>   (action game-state)
>   game-state))
>   game-state
>   (partition 2 pred-actions)))
>
> Then call this function with the game-state and a list of pred/action
> pairs:
>
> (apply-conditional-actions game-state
>safe-cell? reveal-safe-cells
>monster-killed? inc-exp-points)
>
>
>
> --
> 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.


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.  I can't remember which Lisp it was, but there was definitely a
lisp which had an emit-C as it's *only* special form.  It might have been
one of the embedded schemes.

Last time I looked, I also saw ClojureC:  It looked useful, but hasn't been
touched in 3 years.
https://github.com/schani/clojurec

And here's a clojure-to-scheme compiler that used Gambit to target native:
https://github.com/takeoutweight/clojure-scheme
(In fact, this might be what I was thinking about with the special form
above.)

IMHO, native is useful for embedded systems and command-line programs
(where JVM start-up time can make a comand simply unusable).


On Mon, Apr 25, 2016 at 3:47 PM, JvJ  wrote:

>
>
> I've been wondering lately about getting Clojure to compile to native
> code, and so I've been doing some looking around.
>
> There are a few projects that are on the right track, such as TinyClojure
>  and Ferret
> ,
> but they are incomplete and don't seem to be under active development any
> more.
>
> I'm wondering about the requirements, how much work it would take, and
> whether or not it would be worth it.  My current thinking is of a
> Clojure->C/C++ compiler.
>
> So far, I have a few topics for discussion that I'm unclear about that
> might be necessary for this kind of project:
>
>- Can the Immutable Persistent Data Structures be implemented with a
>reference-counting scheme rather than a garbage collector?  This may
>improve performance.
>- In a similar vein, can the allocation strategy be controlled for
>these structures in such a way as to optimize cache locality?
>- Can we take advantage of tail-call optimization in existing C++
>compilers?
>- It wouldn't have to depend on an existing runtime environment like
>JVM or JavaScript.
>   - Could this reduce reliance on reflection and increase performance?
>   - Could a new, clojure-optimized runtime be created that improves
>   performance?
>- Could certain anonymous functions be optimized or inlined in a way
>that improves performance over JVM/JS implementations?
>- Is there a way to compile C++ code at runtime?  This would be
>essential for the REPL and for Macros.
>
>
> Let me know if anyone has any thoughts on the matter.
>
> Thanks
>
> --
> 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.


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 clojure in corporate
environments was sneaked in "under the radar" and a modern legal audit
would be quite a gruelling ordeal for everybody involved in choosing
clojure as a platform,' is quite strong.  And TERRIFYING.  But also
suspicious.

This same verbiage appears in the Apache license and the Artistic license,
meaning that if a corporation were to reject licenses with this clause,
they would need to avoid a significant part of the Java ecosystem
(including Tomcat, Elasticsearch, Hadoop, & Kafka), Node.JS, and Perl.  I
suspect that Hadoop isn't only used "as a hobby" nor is only "sneaked in",
yes?

I am not a lawyer.  Due diligence required.  Your corporation's
requirements might vary.  However, let me dismiss the FUD that the Clojure
or the EPL could never be responsibly used in a corporation.

-Jason


On Sat, Mar 19, 2016 at 11:51 AM, Sam Halliday 
wrote:

> It's got nothing to do with contributing to Clojure (the Grant of Right
> is standard in all modern free software licences). The problem is the
> patent retaliation clause, which I quote from Section 7 of the
> [EPL](http://www.eclipse.org/legal/epl-v10.html)
>
>"If Recipient institutes patent litigation against any entity
>(including a cross-claim or counterclaim in a lawsuit) alleging that
>the Program itself (excluding combinations of the Program with other
>software or hardware) infringes such Recipient's patent(s), then such
>Recipient's rights granted under Section 2(b) shall terminate as of
>the date such litigation is filed."
>
> In other words, if you ever have a legal dispute with anybady about a
> patent violation in clojure (which somebody else could have contributed
> without your permission), then you lose your right to use clojure. As
> in, turn off your production systems, now.
>
> This could be persued by anybody (corporate or individual, including the
> person who you are suing for implementing your patents) who has ever
> contributed to Clojure. Rich Hickey is in a privileged position where he
> can grant ad hoc / tailored licences to corporate customers, granting
> immunity to the patent retaliation clause.
>
> This may not be a concern for small companies or hobbyists, who are
> unlikely to find themselves in such a situation, but it is a major
> concern for corporate entities that are often finding themselves in huge
> IPR counterclaims with their peers. I can only guess that the current
> use of clojure in corporate environments was sneaked in "under the
> radar" and a modern legal audit would be quite a gruelling ordeal for
> everybody involved in choosing clojure as a platform.
>
> So, I can enjoy the language, but only as a hobby.
>
> Best regards,
> Sam
>
>
> --
> 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.
>
> "A. Levy"  writes:
>
> > [ text/plain ]
> > Can you elaborate a little more on those nightmare scenarios? From my
> (amateur) reading of the EPL, it looks like the patent clauses apply to
> contributors to the program. In this case, Clojure. Does developing
> something in Clojure force you to release it under the EPL?
> >
> > --
> > 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 a topic in the
> Google Groups "Clojure" group.
> > To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/i2pHlViYkxg/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to
> clojure+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> Best regards,
> Sam
>
> --
> You 

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 move some of my Lisp
> code to Clojure:
> (defn mpow
> [N M]
> (if (= M 0) 1 "in case pow is 0 return 1"
> (do (* N (recur N (- M 1) "decrease power M each itr"
> )
> So it just calculates power recursively. When I run it the "Too many
> arguments to if" error occures. What am I doing wrong? Thank you in advance
> for help!
>
> Renata
>
> --
> 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.


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 choose stable interfaces that
can reach the entire system, you'll have better luck.

Occasionally, there will be a small function or piece which it makes sense
to test in isolation.  Perhaps it will have a stable and well-understood
interface, but the implementation is complicated or tricky.

What happens next is that people notice (or complain) about the large
amount of variation which needs to be pushed through the interface, and
they start to have long tests as they build data.  The solution here is
another piece of perfectly fine wisdom that is counter to some popular
wisdom:  Extract duplication and abstractions from the tests to create a
library that expressively drives your application (cf. "DRY code, wet
tests").

This works super well in Clojure.

-Jason

P.S. This is Detroit-style TDD - mock very rarely at the edges of the
system; test through a few interfaces; slop code in, make it work, then
make it pretty, extract and remove duplication; in other words, "make the
design simpler through refactoring."

This is opposed to London-style TDD - test each component in isolation
using mocks, keep tests wet, use testing pain to tell you that you have too
many dependencies or are making bad APIs, work top down, and have separate
integration tests to tell you the system works.

People argue the merits of each, but the worst thing happens when they are
confused and someone tries to do Detroit with wet tests or isolation, or
London with ... refactoring?  (That might be disingenuous–not my school).
A note: London is usually about making simple object hierarchies and I
don't think it can apply to Clojure.


On Thu, Mar 3, 2016 at 6:11 AM, Timur  wrote:

> Hi all,
>
> I generally create composable functions that depend on certain keys of an
> input map and compose them using threading macros. However testing
> functions separately is somehow cumbersome as each fn depends on the output
> of another one.
>
> How do you test these? What is the best way to test them using Midje? Any
> examples will be appreciated...
>
> Regards,
>
> Timur
>
> --
> 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.


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 dispatch the first element of the list.  (Not
eval, or apply, since security is a concern.)  If you want nested
expressions, a simple evaluator does essentially this, except evaluates
arguments first.

With a little finess, you could instead allow only public symbols from a
specific namespace in the first position, and call those functions in a
secure way.

3. JLine is the command-line editing library that's like readline for Java.




On Tue, Feb 16, 2016 at 8:06 AM, Nick Vargish  wrote:

> My current project requires a command-line interpreter with limited
> functionality... For various non-technical reasons we can't expose bash to
> our users.
>
> Our plans call for writing a console shell that will accept some limited
> command set, and Clojure would be the natural implementation language,
> since much of our functionality has been implemented in a Clojure library.
> We even have a command-line tool that exposes a lot of the functionality to
> shell scripts, but the parsing/function routing is quite primitive...
>
> Any suggestions? Has anyone done work on a CLI implemented in Clojure?
>
> Thanks,
>
> Nick
>
>
>
> --
> 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.


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, 2016 at 9:12 AM, Bozhidar Batsov  wrote:

> If you're into tooling - there's always plenty of work to be done on
> cider-nrepl (https://github.com/clojure-emacs/cider-nrepl) :-)
>
> On 2 February 2016 at 10:28, Chris Howe-Jones 
> wrote:
>
>> Another open source library that has some real momentum behind it at the
>> moment is baid-chat https://github.com/braidchat/meta/wiki . It's the
>> Clojure Communities OSS alternative to Slack.
>>
>> Why is it needed? Lots of reasons that are elaborated in the motivations
>> page of the wiki but one of the most urgent is that Slack has adopted a
>> policy of closing community teams to new members once they get large
>> (anecdotally around 7000 members) and the Clojurians Slack channel is
>> already over 4800.
>>
>>
>> On 2 Feb 2016, at 08:22, Mikera  wrote:
>>
>> If you are interested in data science, help with core.matrix and the
>> associated libraries is always appreciated, and we are very
>> contributor-friendly in the numerical Clojure community.
>>
>> On Monday, 1 February 2016 18:51:37 UTC+8, Steven Deobald wrote:
>>>
>>> Hey folks!
>>>
>>> Today is the first day nilenso has ever had an intern on-staff. He's
>>> been in the industry for a few years but he's relatively new to Clojure. We
>>> try to ramp people up as slowly and supportively as possible. For interns,
>>> we figure writing (and re-writing, natch) open source is the safest place
>>> to start.
>>>
>>> With that context set, does anyone on the list have suggestions for
>>> projects we can guide him through? We will be working with him through some
>>> the standard Clojure literature over the coming months, as well as
>>> providing guidance with his patches/pull-requests.
>>>
>>> We're open to any shape of project: applications, libraries, tools. If
>>> you have a Clojure project you would like help with (or that you wish
>>> someone would start), we would love to evaluate it as a learning
>>> opportunity.
>>>
>>> Thanks everyone!
>>>
>>> Steven Deobald -- ⌀ -- nilenso.com
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "London Clojurians" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to london-clojurians+unsubscr...@googlegroups.com.
>> To post to this group, send email to london-clojuri...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/london-clojurians.
>> 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.
>

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

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:

>
>
> 
> Hello. I'm still a Clojure newbie and had a bit of code return what seems
> to be the wrong value.
>
>
>
> 
> After typing in (map inc [1 2 3 4]) I would expect to get [2 3 4 5].
> However my Clojure repl returns [1 2 3 4]. This is happening on windows.
> I've included a screenshot as well. Is this sort of behaviour (where the
> wrong answer appears) normal in Clojure and are there any implications for
> real time code?
>
> --
> 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.


[ANN] avi 0.1.8

2016-01-07 Thread Jason Felice
This release is about WORDS!

Motions implemented:
w, W, e, E, b, B, ge, gE (all motions work with d).

Fixes:
* Fix wrong cursor position after J
* {count} works correctly on t,T,f,F
* dl at end of line deletes character
*  cancels command-line
* Command-line cleared after  or  in position 0
* {count}dk and {count}dj with large {count} delete until BOF or EOF

ALSO, a blog post: Avi is a Spec, First
<http://maitria.github.io/avi//avi/technical/2015/12/02/avi-is-a-spec-first.html>


https://github.com/maitria/avi

avi

A lively vi.
<https://github.com/maitria/avi#vision>Vision

We love vim. We want more! Test coverage. Flexibilty. Live REPLs!
<https://github.com/maitria/avi#guiding-principles>Guiding Principles

   - Test driven. All functionality covered by tests.
   - Don't 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 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/eraserhd> - or gchat.
<https://github.com/maitria/avi#status>Status

Our intention is for the unit tests to provide friendly documention of
what's been implemented so far. To run the unit tests with verbose output,
use

$ lein midje :print-facts

<https://github.com/maitria/avi#installing>Installing

   - Works with Leiningen 2.3.4
   - On Linux, ncurses-dev or curses-dev or equivalent must be installed.

$ git clone https://github.com/maitria/avi.git
$ cd avi
$ lein install /usr/local

On Linux, you'll likely not have access to /usr/local. In that case you'll
need to use sudo lein install instead or specify a different installation
directory.
<https://github.com/maitria/avi#license>License

Copyright 2014 Maitria

You have permission to use this in any way you like (modify it, sell it,
republish it), provided you agree to all the following conditions:

   - you don't mislead anyone about it
   - you don't interfere with our ability to use it
   - you release us from any claims of liability if it causes problems for
   you

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


[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.
+>

Threads value through forms in much the same way as ->, except for special
handling of the following forms:
if,
if-not, if-let, when, when-not, when-let:

The value is threaded through the *then* and *else* clauses independently,
leaving the test conditions alone. If an else clause is missing, it is will
be supplied as though the value had been threaded through identity.

For example,

(+> 42 (if true inc)) ;=> 43
(+> 42 (if false inc)) ;=> 42

In when, when-not, and when-let forms, the value is threaded through every
form in the body, not just the last.
case

The values being compared are left untouched and the value is threaded
through the expr clause of each condition.

For example,

(+> 42
  (case 1
1 inc
2 dec)) ;=> 43

(+> 42
  (case 2
1 inc
2 dec)) ;=> 41

cond

The test clauses are left untouched and the value is threaded through the
expr clauses of each condition. If there's no:else condition, +> pretends
it was (identity).

For example,

(+> 42
  (cond
(= 1 2)
inc)) ;=> 42

(+> 42
  (cond
(= 1 1)
dec)) ;=> 41

do

The current expr is threaded through the body forms of the do.
let

The current expression is threaded through the body of the let form, with
the bindings in place. For example:

(+> 42
  (let [x 1]
(+ x))) ;=> 43

try

The current expression is threaded through the body of the try form. The
*same* value is threaded through each catchclause and any finally clause.

(+> 42 (try
 inc
 (catch Exception e
   dec)) ;=> 43

(+> 42 (try
 (+ :foo)
 (catch Exception e
   dec))) ;=> 41

(+> 42 (try
 inc
 (finally dec))) ;=> 42

in

Threads inner expressions through a lens

of
value.

lens is a function with two arities - 1 and 2. The 1-arity body is the
"get" function, while the 2-arity body is the "putback" function. "get"
lifts the value into the new context, while "putback" translates the value
back to the original context.

For example,

(+> 42
(in (fn
  ([v] (/ v 2))
  ([v u] (* u 2)))
  inc)) ;=> 85/2

This can be thought of as 'lifting' the body expressions into the 'world
where things are half as large'.

As a special case, if lens is a keyword, in assumes that value is a map and
that sub-key are threaded through the inner expressions.

For example,

(+> {:hello 42}
(in :hello
  (+ 5))) ;=> {:hello 47}

This macro can only be used inside +> or +>>.
+>>

Threads expressions like ->>, except with the handling of the special forms
above.
fn+>

Like fn, except threads the function's first argument through the body
using +> . The parameter vector can be omitted, in which case the resulting
function takes one parameter.

((fn+> [x y] (+ x)) 7 3) ;=> 14
((fn+> inc inc) 42) ;=> 44

Installing

Leiningen  dependency information:

[com.maitria/packthread "0.1.7"]

Usage

(require '[packthread.core :refer :all])

(+> 42
(if true
  inc)) ;=> 43

See core_test.clj

for
examples of usage.
License

Copyright 2014 Maitria

You have permission to use this in any way you like (modify it, sell it,
republish it), provided you agree to all the following conditions:

   - you don't mislead anyone about it
   - you don't interfere with our ability to use it
   - you release us from any claims of liability if it causes problems for
   you

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

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 event)
 ...
 ) => world'

(def processor
  (-> root-middleware
some-other-middleware
...))

Each processor can respond to some subset of events and ignore the rest.
In this case I folded "basket" into world.

I've thought a bit about making data-driven middleware and how to register
or deregister, but not come up with a decent solution – mostly because
ordering is often important.


On Mon, Dec 7, 2015 at 6:01 AM, Colin Yates  wrote:

> Hi all,
>
> (apologies for the wall of text but I think the context might be useful)
>
> I am using event sourcing so the world, at any given point in time is
> simply a `reduce` over those events. Throughout the application different
> things are interested in different events.
>
> A design that is emerging is the notion of a 'world' which knows how to
> consume the various events and allows other parts of the system to respond
> to certain states having happened. All of this is in-memory and could be
> client or server side (yay for .cljc and ClojureScript).
>
> In concrete terms imagine I have am modelling shopping baskets (again, all
> in memory). I might be interested in knowing:
>  - whenever a certain item is added to a basket
>  - whenever a basket is cancelled
>  - whenever a complete basket is ordered
>
> I could of course just filter the event log and pick out those events but
> I typically want the entire entity _as it was when that event happened_, so
> the event itself isn't sufficient.
>
> My question is how best to model the 'I am interested in pre-x and
> post-y'. In general, it is interesting to know the event, the aggregate
> root (shopping basket) that event is associated with and the world (both
> the aggregate root and the world as they were at the time of the event).
>
> I could have an EventObserver: (defprotocol EventObserver  (observe [this
> event entity world]) which the world notifies. One part of the system will
> have one set of EventObservers, another will have a different set of
> EventObservers. Also, some parts need to know _before_ the event and others
> _after_ the event.
>
> I don't want each Observer to have to specify every single event so a
> protocol defining a pre/post method for each event wouldn't work because
> (AFAIK) you can't have a default implementation of a protocol and you can't
> have a partial implementation of a protocol.
>
> Where I am at is thinking that the world understands a map of
> EventObservers, with one key for each pre/post event:
>
> {:pre-event-one EventObserver :post-event-one EventObserver
>  :pre-event-two EventObserver :post-event-two EventObserver}
>
> etc.
>
> and each Observer can register their own map of EventObservers. I can
> optimise the code by either having the world handle nil EventObserver or
> having a default fully-populated map of EventObservers which Observers can
> simple assoc their own handlers onto.
>
> Building the world is then trivially (usual disclaimer - hacky
> stream-of-consciousness code):
>
> (defn- locate-entity [world entity] ...)
> (defn- update-entity! [world entity] ...)
>
> (defn- process-event [{:keys [observers world] :as result} event]
>   (let [pre-handler-kw (keyword (str 'pre-' (name (:event-type event
>  post-handler-kw (keyword (str 'post-' (name (:event-type event)))
>  pre-entity (locate-entity world event)
>  new-world (update-entity world entity)
>  post-entity (locate-entity new-world event]
> (do all (for [o observers
>   :let [pre-event-observer (pre-handler-kw o)
> post-event-observer (post-handler-kw o)]]
>  (when pre-event-observer (pre-event-observer event
> pre-entity world))
>  (when post-event-observer (post-event-observer event
> post-entity new-world
>(assoc result :world new-world))
>
> (defn build-world [events observers]
>   (reduce process-event {:world {} :observers observers} events))
>
> The above code could be improved in a myriad of ways, but hopefully it is
> clear enough to highlight the problem: what mechanism is idiomatic in
> Clojure to implement the Observers where each Observer is interested in a
> subset of before and after a subset of events.
>
> If you are thinking 'duh, this is obvious - use X' or 'what! that's not
> true of course you can do X with protocols' then yep, I have almost
> certainly overlooked something.
>
> Finally - yeah, at times like this I really miss AOP.
>
> Thanks for still reading :-)
>
> 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 

[ANN] avi 0.1.7

2015-11-30 Thread Jason Felice
Changes:

   - Rewritten normal mode (based on a state machine).  This means that
   adding all the weird phases of a normal-mode command should be really easy
   (and all sorts of operators and motions should be coming down the pike!)
   - The "d" operator now works for all motions previously implemented,
   e.g. d$, d0, dj ...
   - f*{char}*, t*{char}*, F*{char}*, T*{char}* motions (also work with "d")
   - Fix for cursor placement after L, M, H

I'm now hanging out in #avi on the Clojurians slack.  If you try it out,
tell me about it, request features, or just complain. :)

avi

A lively vi.
<https://github.com/maitria/avi#vision>Vision

We love vim. We want more! Test coverage. Flexibilty. Live REPLs!
<https://github.com/maitria/avi#guiding-principles>Guiding Principles

   - Test driven. All functionality covered by tests.
   - Don't 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 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/eraserhd> - or gchat.
<https://github.com/maitria/avi#status>Status

Our intention is for the unit tests to provide friendly documention of
what's been implemented so far. To run the unit tests with verbose output,
use

$ lein midje :print-facts

<https://github.com/maitria/avi#installing>Installing

   - Works with Leiningen 2.3.4
   - On Linux, ncurses-dev or curses-dev or equivalent must be installed.

$ git clone https://github.com/maitria/avi.git
$ cd avi
$ lein install /usr/local

On Linux, you'll likely not have access to /usr/local. In that case you'll
need to use sudo lein install instead or specify a different installation
directory.
<https://github.com/maitria/avi#license>License

Copyright 2014 Maitria

You have permission to use this in any way you like (modify it, sell it,
republish it), provided you agree to all the following conditions:

   - you don't mislead anyone about it
   - you don't interfere with our ability to use it
   - you release us from any claims of liability if it causes problems for
   you

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


[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.
Why?

Because every time you've wanted to:

(-> 42
  (let [x 79]
(+ x)
  inc)

but clojure wouldn't let you.
+>

Threads value through forms in much the same way as ->, except for special
handling of the following forms:
if,
if-not, if-let, when, when-not, when-let:

The value is threaded through the *then* and *else* clauses independently,
leaving the test conditions alone. If an else clause is missing, it is will
be supplied as though the value had been threaded through identity.

For example,

(+> 42 (if true inc)) ;=> 43
(+> 42 (if false inc)) ;=> 42

In when, when-not, and when-let forms, the value is threaded through every
form in the body, not just the last.
case

The values being compared are left untouched and the value is threaded
through the expr clause of each condition.

For example,

(+> 42
  (case 1
1 inc
2 dec)) ;=> 43

(+> 42
  (case 2
1 inc
2 dec)) ;=> 41

cond

The test clauses are left untouched and the value is threaded through the
expr clauses of each condition. If there's no:else condition, +> pretends
it was (identity).

For example,

(+> 42
  (cond
(= 1 2)
inc)) ;=> 42

(+> 42
  (cond
(= 1 1)
dec)) ;=> 41

do

The current expr is threaded through the body forms of the do.
let

The current expression is threaded through the body of the let form, with
the bindings in place. For example:

(+> 42
  (let [x 1]
(+ x))) ;=> 43

try

The current expression is threaded through the body of the try form. The
*same* value is threaded through each catchclause and any finally clause.

(+> 42 (try
 inc
 (catch Exception e
   dec)) ;=> 43

(+> 42 (try
 (+ :foo)
 (catch Exception e
   dec))) ;=> 41

(+> 42 (try
 inc
 (finally dec))) ;=> 42

in

Threads inner expressions through a lens

of
value.

lens is a function with two arities - 1 and 2. The 1-arity body is the
"get" function, while the 2-arity body is the "putback" function. "get"
lifts the value into the new context, while "putback" translates the value
back to the original context.

For example,

(+> 42
(in (fn
  ([v] (/ v 2))
  ([v u] (* u 2)))
  inc)) ;=> 85/2

This can be thought of as 'lifting' the body expressions into the 'world
where things are half as large'.

As a special case, if lens is a keyword, in assumes that value is a map and
that sub-key are threaded through the inner expressions.

For example,

(+> {:hello 42}
(in :hello
  (+ 5))) ;=> {:hello 47}

This macro can only be used inside +> or +>>.
+>>

Threads expressions like ->>, except with the handling of the special forms
above.
fn+>

Like fn, except threads the function's first argument through the body
using +> . The parameter vector can be omitted, in which case the resulting
function takes one parameter.

((fn+> [x y] (+ x)) 7 3) ;=> 14
((fn+> inc inc) 42) ;=> 44


Installing

Leiningen  dependency information:

[com.maitria/packthread "0.1.7"]

Usage

(require '[packthread.core :refer :all])

(+> 42
(if true
  inc)) ;=> 43

See core_test.clj

for
examples of usage.
License

Copyright 2014 Maitria

You have permission to use this in any way you like (modify it, sell it,
republish it), provided you agree to all the following conditions:

   - you don't mislead anyone about it
   - you don't interfere with our ability to use it
   - you release us from any claims of liability if it causes problems for
   you

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

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 a bad implementation, now that I think of it):

Would it be useful to file a ticket for a new arity for iterate?:

(defn iterate
  ...
  ([f x n]
   (if (zero? n)
 x
 (recur f (f x) (dec n

There's a little bit of weirdness - this returns a single value, while the
other arity returns a lazy sequence.  However, I think it's the correct
name (and the original arity might  have better been named "iterations" for
symmetry with "reduce" and "reductions").  But ah well.

Thoughts?

-- 
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: 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.
>
> (defn expected [exp was]
>   (format "Expected `%s` but was `%s`" (pr-str exp) (pr-str was)))
>
> (println (expected 2 "2"))
> ;=> Expected `2` but was `"2"`
>
>
>
> > On Nov 13, 2015, at 6:55 AM, Colin Yates  wrote:
> >
> > Hi all,
> >
> > Can we, the community agree a consistent way of rendering Clojure EDN
> when we report it in info or error. For example, given the EDN "2" (i.e. a
> string containing a single character 2) I have seen various libraries
> render it as:
> >
> >  - 2
> >  - "2"
> >  - ["2"]
> >  - [2]
> >  - (2)
> >  - '"2"'
> >
> > I would like to propose that we standardise around "_" as the boundary
> character as that isn't likely to be used in (except for some markup I
> guess but that is pretty unlikely), so a test framework might render as
> such:
> >
> >  - expected _2_ but was _"2"_
> >
> > Please? :-)
>
> --
> 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.


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

2015-10-26 Thread Jason Felice
It works great.  All I did was updated project.clj, replaced s/both with
s/constrained and removed the s/pred around the arguments, and it all
worked.

One little weird thing: It now complains:
WARNING: atom already refers to: #'clojure.core/atom in namespace:
schema.core, being replaced 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 <jason.m.fel...@gmail.com>
wrote:

> Thanks!
>
> I'll try it out this week and let you know.
>
> On Sun, Oct 25, 2015 at 8:28 PM, Jason Wolfe <ja...@w01fe.com> 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 Felice wrote:
>>>
>>>
>>> On Wed, Sep 2, 2015 at 9:56 PM, Jason Wolfe <ja...@w01fe.com> 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 thinking about whether it's worth the extra
>>>> complexity to support that, what are your thoughts?  If you think it would
>>>> be valuable, please open another issue on github so we can track it --
>>>> thanks.
>>>>
>>>
>>> Postconditions are what I reached for intuitively, and so I suspect many
>>> other people will also try to figure them out.  It "feels good" if one is
>>> anticipating a generator and knows about gen/such-that, for example.
>>>
>>> I haven't looked at the Schema generation API yet, but I'd like to not
>>> need to specify leaf generators (except perhaps for performance reasons).
>>>
>>> That said, s/both is both (ha!) awkwardly named (since it can take more
>>> than two) and not a mechanism I'm attached to.  Perhaps there's another
>>> way?  I'd be happy if there is a concise, recommended, well-documented way,
>>> even if (like gen/bind) I have to jump through a few mental hoops to figure
>>> out how to phrase it.
>>>
>>> -Jason
>>>
>> --
>> 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.


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 <ja...@w01fe.com> 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 Felice wrote:
>>
>>
>> On Wed, Sep 2, 2015 at 9:56 PM, Jason Wolfe <ja...@w01fe.com> 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 thinking about whether it's worth the extra
>>> complexity to support that, what are your thoughts?  If you think it would
>>> be valuable, please open another issue on github so we can track it --
>>> thanks.
>>>
>>
>> Postconditions are what I reached for intuitively, and so I suspect many
>> other people will also try to figure them out.  It "feels good" if one is
>> anticipating a generator and knows about gen/such-that, for example.
>>
>> I haven't looked at the Schema generation API yet, but I'd like to not
>> need to specify leaf generators (except perhaps for performance reasons).
>>
>> That said, s/both is both (ha!) awkwardly named (since it can take more
>> than two) and not a mechanism I'm attached to.  Perhaps there's another
>> way?  I'd be happy if there is a concise, recommended, well-documented way,
>> even if (like gen/bind) I have to jump through a few mental hoops to figure
>> out how to phrase it.
>>
>> -Jason
>>
> --
> 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.


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 16:33, ru  wrote:
>
> Thank you, Colin.
>
> This works:
>
> user=> (as-> {:x 5} x1 (if (> (get x1 :x) 3) (assoc x1 :y 6) x1) (if (<=
> (get x1 :x) 3) (assoc x1 :y 12) x1))
> {:y 6, :x 5}
>
> But without cond-> at all :( :)
>
> пятница, 2 октября 2015 г., 17:49:28 UTC+3 пользователь ru написал:
>>
>> Hi,
>>
>> Can I use in tests threading expression of cond->, and how?
>>
>> Thanx in advance,
>>   Ru
>>
>
> --
> 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.


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 second pass at it?
4. Why would you do this to me?

I hope to write a blog or something on this, but I wanted to check in here
first.  Any ideas on how to talk about this?

Thanks,
-Jason

-- 
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: The middleware pattern

2015-10-02 Thread Jason Felice
@Raymond I like the illustration a lot.  Perhaps I will use something like
this.
@Marc I think this would likely be like "monad burritos"... it makes sense
to people who understand it in the first place.  Although, I noticed when
trying to explain it today, that I had a concept of "size" in my mind -
it's sort of connected to "layer of abstraction".

On Fri, Oct 2, 2015 at 2:59 PM, Raymond Huang <12ay.hu...@gmail.com> wrote:

> To follow up on middleware, this is a great picture to demonstrate it.
>
> 687474703a2f2f692e737461636b2e696d6775722e636f6d2f68623864422e706e67
> <https://camo.githubusercontent.com/9dbd86eb82809faf875ab0078771002b7ef357df/687474703a2f2f692e737461636b2e696d6775722e636f6d2f68623864422e706e67>
>
> On Fri, Oct 2, 2015 at 2:43 PM, Marc O'Morain <m...@circleci.com> wrote:
>
>> Could you use Russian Dolls as an analogy? To build a Russian doll (or to
>> build middleware) you start out with the smallest doll, and put it inside
>> the second smallest, which in turn goes inside the third smallest. When
>> opening the doll (calling the function) you start with the largest doll,
>> and 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, outermost
>> doll first.
>>
>>
>>
>> On Fri, Oct 2, 2015 at 8:10 PM, Jason Felice <jason.m.fel...@gmail.com>
>> wrote:
>>
>>> 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 second pass at it?
>>> 4. Why would you do this to me?
>>>
>>> I hope to write a blog or something on this, but I wanted to check in
>>> here first.  Any ideas on how to talk about this?
>>>
>>> Thanks,
>>> -Jason
>>>
>>> --
>>> 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.
>

-- 
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: The middleware pattern

2015-10-02 Thread Jason Felice
@Matthew It also follows the dot notation for function composition, right?
This makes sense, but then:

(def iso8601->timestamp
  (comp date-time->timestamp iso8601->date-time))


On Fri, Oct 2, 2015 at 5:39 PM, Matthew Boston <matthew.bos...@gmail.com>
wrote:

> comp isn't backwards, it's just "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?
>>
>> 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 second pass at it?
>> 4. Why would you do this to me?
>>
>> I hope to write a blog or something on this, but I wanted to check in
>> here first.  Any ideas on how to talk about this?
>>
>> Thanks,
>> -Jason
>>
> --
> 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.


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 thinking about whether it's worth the extra
> complexity to support that, what are your thoughts?  If you think it would
> be valuable, please open another issue on github so we can track it --
> thanks.
>

Postconditions are what I reached for intuitively, and so I suspect many
other people will also try to figure them out.  It "feels good" if one is
anticipating a generator and knows about gen/such-that, for example.

I haven't looked at the Schema generation API yet, but I'd like to not need
to specify leaf generators (except perhaps for performance reasons).

That said, s/both is both (ha!) awkwardly named (since it can take more
than two) and not a mechanism I'm attached to.  Perhaps there's another
way?  I'd be happy if there is a concise, recommended, well-documented way,
even if (like gen/bind) I have to jump through a few mental hoops to figure
out how to phrase it.

-Jason

-- 
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: [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 can tell), I can't verify the type is numeric before
applying pos?

I could do this: (s/conditional number? (s/pred pos?)), but I'm going to
guess this will defeat test.check support, which I'd like to use.

Thoughts?

On Tue, Sep 1, 2015 at 2:02 PM, Jason Wolfe  wrote:

> We're excited to finally bring Schema out of alpha, while introducing some
> new exciting features around testing: test.check integration and data
> completion.  Check out the blog post for details about these new
> applications.
>
> http://blog.getprismatic.com/schema-1-0-released/
>
> We've also rewritten the internals of schema for this release, to make it
> easier and faster to add new schema types and applications.  We expect
> ordinary users of Schema should see no breaking changes, but custom schema
> types or tooling will likely need to be updated.  Please see the changelog
> for details.
>
> https://github.com/Prismatic/schema/blob/master/CHANGELOG.md
>
> Comments and suggestions welcome!
>
> --
> 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.


Re: Scanners suitable for syntax highlighting?

2015-04-11 Thread Jason Felice
I think LispReader.java fails at #1 as well.

On Fri, Apr 10, 2015 at 9:34 PM, Bill Cohagan coha...@acm.org wrote:

 How about Clojure's LispReader.Java at
 https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java.
 Don't know if it'd do #3 (saving state 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 '(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 information
 3. It is restartable if the state is saved from the start point.
  (Necessary for large files.)

 Thanks in advance!
 -Jason

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


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 information
3. It is restartable if the state is saved from the start point.
 (Necessary for large files.)

Thanks in advance!
-Jason

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


[ANN] avi 0.1.6 (searching)

2015-04-04 Thread Jason Felice
In this version:

* Fix for `O` on a blank line (Thanks to Anthony Garreffa!)
* Command history for the `:` prompt (using ^N, ^P)
* Implement `/`, `?`, `n`, `N`
* Refactored to compose most of the editor in a middleware pattern

avi

A lively vi.
https://github.com/maitria/avi#visionVision

We love vim. We want more! Test coverage. Flexibilty. Live REPLs!
https://github.com/maitria/avi#guiding-principlesGuiding Principles

   - Test driven. All functionality covered by tests.
   - Don't defeat vim muscle memory.
   - Code is for people. Be expressive as hell.
   - Be friendly. Especially to noobs.

https://github.com/maitria/avi#contributingContributing

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 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/eraserhd - or gchat.
https://github.com/maitria/avi#statusStatus

Our intention is for the unit tests to provide friendly documention of
what's been implemented so far. To run the unit tests with verbose output,
use

$ lein midje :print-facts

https://github.com/maitria/avi#installingInstalling

   - Works with Leiningen 2.3.4
   - On Linux, ncurses-dev or curses-dev or equivalent must be installed.

$ git clone https://github.com/maitria/avi.git
$ cd avi
$ lein install

On Linux, you'll likely not have access to /usr/local. In that case you'll
need to use sudo lein install instead.
https://github.com/maitria/avi#licenseLicense

Copyright 2014 Maitria

You have permission to use this in any way you like (modify it, sell it,
republish it), provided you agree to all the following conditions:

   - you don't mislead anyone about it
   - you don't interfere with our ability to use it
   - you release us from any claims of liability if it causes problems for
   you

-- 
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: Packaging JNI extensions

2015-03-24 Thread Jason Felice
I'm a little weirded out by writing binary code out of a jar to a temporary
directory; on the other hand, this does improve distribution, doesn't it?
I imagine all sorts of potential problems, though: 1) multiple copies of
the program overwrite the same file (if a predictable name is used), and
also have a security race, or alternately 2) litering the /tmp/ directory
with bunches of libs.  And also 3) this will hurt startup performance,
which is important in my case.

This means that I would have to take on building this for all of the binary
platforms, which is a chore; and (again) on the other hand, it's a chore
that would allow other apps to never have to have this problem.

(Avi is a console-based editor, the JNI portion is an ncurses wrapper.)

On Mon, Mar 16, 2015 at 12:08 PM, Philippe Guillebert 
philippe.guilleb...@gmail.com wrote:

 Hi

 I'm not sure what Avi is in this context, maybe what you're looking for
 is a way to package and run native JNI code from an uberjar ? I recently
 released https://github.com/pguillebert/indigenous that may help in this
 purpose. You still need to find a maven artifact 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 jason.m.fel...@gmail.com
 wrote:

 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-platform and all?

 Thanks
 -Jason

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




 --
 Philippe

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


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-platform and all?

Thanks
-Jason

-- 
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: [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 4:13 PM, Karsten Schmidt i...@toxi.co.uk wrote:

 That's a good point, Bruce! To be honest, I don't know anymore, but it
 makes complete sense to change it. Consider it done! :)

 As for your mapping question, yes, of course! I've done a few of them.
 E.g. the first pic on the website [1] was a project for The ODI in
 2013 and is a map of different council/borough stats of London (here
 knife crime). The shape files were first retrieved  processed with
 the thi.ng/trio lib directly from the UK statistics office's SPARQL
 endpoint [2], then projected to Mercator, converted to 2d polygons,
 smoothed them and then extruded as 3D walled meshes and exported as
 STL files using geom. To create that rendered image, another function
 then combined all borough meshes into a complete render scene for
 Luxrender (using the luxor lib). Since this all was for a 60sec
 animation, I also wrote the tweeny lib for that project to allow me to
 define the timeline for the various camera, mesh, light  shader
 changes. The whole bundle was then sent to EC2 and rendered on 340+
 CPUs... basically, spawned a private render farm.

 Alternatively with  30 lines of code you could query any UK
 constituency (or use similar endpoints for other countries), do those
 initial shape transformations and send the resulting STL mesh file
 straight to a 3D printer... For online use, of course the SVG or WebGL
 modules would be more interesting, but these really would just deal
 with that last transformation/visualization step, i.e. turning a
 thi.ng.geom.Polygon2 into an SVG polygon node or tesselate it and
 stuff it into WebGL buffer to display...

 For more flexible mapping, it'd be great to port some/all of the
 projections from [3] in its own clj lib for easier (and non-JS
 related) access...

 [1] http://thi.ng/img/04.jpg
 [2] http://statistics.data.gov.uk/doc/statistical-geography
 [3] https://github.com/d3/d3-geo-projection/

 Hth!

 On 25 February 2015 at 22:34, Bruce Durling b...@otfrom.com wrote:
  Karsten,
 
  Is there a reason why you went with a README.md and then an index.org
  rather than a plain README.org?
 
  (love all the rest of it and loved your use of it at The Barbican. I
  need to get my head around it all. I'm wondering if I can use it for
  some of the geographic and other charting things I do a lot of).
 
  cheers,
  Bruce
 
  On Wed, Feb 25, 2015 at 5:06 AM, Karsten Schmidt i...@toxi.co.uk
 wrote:
  Hi guys,
 
  thi.ng is a collection of over a dozen largely x-platform Clojure 
  Clojurescript libs for computational/generative design  data
  visualization tasks.
 
  I just wanted to give a little heads up that this project has recently
  seen a number of releases and, as a whole, by now is generally quite
  stable and usable (*is used*) for realworld projects (although most
  libs remain in constant parallel development to make them more feature
  complete). I've collated a number of images of projects and links to
  the most important libs here:
 
  http://thi.ng/
 
  Most notably of those:
 
  http://thi.ng/geom
  By far the largest sub-project and backbone for most others: A 2D/3D
  geometry package w/ comprehensive vector algebra, swizzling,
  intersections, matrix types  helpers, quaternions, pure shape
  primitives with ~50 protocols for polymorphic enquiry  manipulation,
  meshes (incl. I/O), mesh subdivisions, CSG mesh ops, Verlet physics
  engine (only particles, springs, behaviors)... Most of this lib is
  pure geometry w/ no rendering specifics, although there're separate
  modules for SVG rendering w/ shader support  decorators [1], WebGL
  wrapper and converters from shapes/meshes to VBOs and various shader
  presets/utils.
 
  http://thi.ng/shadergraph
  GLSL (WebGL) pure function library  dependency graph (based on
  com.stuartsierra/dependency), GLSL minification during CLJS compile
  time
 
  http://thi.ng/color
  RGB, HSV, CMYK, CSS conversions, color presets (incl. D3 category
 schemes)
 
  http://thi.ng/luxor
  Complete scene compiler DSL for http://luxrender.net, based around
 thi.ng/geom
 
  http://thi.ng/morphogen
  Declarative 3D form evolution through tree-based transformations,
  basically an AST generator of geometric operations to transform a
  single seed node into complex 3D objects
 
  http://thi.ng/tweeny
  Interpolation of nested (presumably animation related) data
  structures. Allows tweening of deeply nested maps/vectors with
  completely flexible tween fns/targets and hence easy definition of
  complex timelines
 
  http://thi.ng/validate
  Purely functional, composable data validation  optional corrections
  for nested data. Supports both maps  vectors, wildcards, comes with
  many 

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 clooj...@gmail.com wrote:

 Hi,

 I've been using Clojure  Vim for a year now, with fireplace, etc.
  However, it seems that Exuberant Ctags is a bit crippled since I have not
 found a way to make it understand namespace aliases. In my current work it
 seems that nearly every function is in a separate namespace with a
 namespace alias.

 Unless there is already a tool (or a ~/.ctags regex) to do that, I was
 thinking about writing a lein plugin (in clojure) to decode namespace
 aliases in the (ns...) form and create a tags file from scratch. About a
 year ago (in a previous job), I had to write a similar tool (in Groovy) to
 create the tags file for PL/I code, so I'm familiar with the ctags file
 format.

 Any thoughts?

 Alan

 P.S.  I have been experimenting with LightTable but GVim is still my
 day-to-day workhorse.

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


[ANN] avi 0.1.5

2014-07-06 Thread Jason Felice
This release adds u (undo), ^R (redo), J (join lines), % (jump to matching
bracket), makes `a` behave correctly on a zero-length line, and handles
repeat counts on insert-mode commands (e.g. 3oxxEsc).

*Started Dogfooding*

Additionally, the features and fixes in this version were mostly written
using Avi itself, as I've set up shell aliases to make Avi my own default
vi.

This trello board https://trello.com/b/E2LFvVLy/avi has a dogfood column,
and whenever I make Avi beep (in a case where vim wouldn't have), I add a
card or bump an existing card one higher.

avi

A lively vi.
https://github.com/maitria/avi/blob/master/README.md#visionVision

We love vim. We want more! Test coverage. Flexibilty. Live REPLs!
https://github.com/maitria/avi/blob/master/README.md#guiding-principlesGuiding
Principles

   - Test driven. All functionality covered by tests.
   - Don't defeat vim muscle memory.
   - Code is for people. Be expressive as hell.
   - Be friendly. Especially to noobs.

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 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/eraserhd - or gchat.
https://github.com/maitria/avi/blob/master/README.md#statusStatus

Our intention is for the unit tests to provide friendly documention of
what's been implemented so far. To run the unit tests with verbose output,
use

$ lein midje :print-facts

https://github.com/maitria/avi/blob/master/README.md#installingInstalling

   - Works with Leiningen 2.3.4
   - On Linux, ncurses-dev or curses-dev or equivalent must be installed.

$ git clone https://github.com/maitria/avi.git
$ cd avi
$ lein install

On Linux, you'll likely not have access to /usr/local. In that case you'll
need to use sudo lein install instead.
https://github.com/maitria/avi/blob/master/README.md#licenseLicense

Copyright 2014 Maitria

You have permission to use this in any way you like (modify it, sell it,
republish it), provided you agree to all the following conditions:

   - you don't mislead anyone about it
   - you don't interfere with our ability to use it
   - you release us from any claims of liability if it causes problems for
   you

-- 
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: 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 20, 2014 at 4:06 AM, Phillip Lord phillip.l...@newcastle.ac.uk
wrote:



 I've been struggling with leiningen project hooks as I believe that I
 need them for my current project.

 I am writing an manual with code examples, using a literate programming
 technology. The main source is in asciidoc, but I can untangle these to
 produce valid clojure, which I can then evaluate and test.

 To do this, however, I need to run an external process to generate the
 source -- i.e. the Clojure files which are not really source in this
 case, before I try to load them and test the functions in them. In
 Maven, I can do this with the exec plugin by attaching to the initialize
 phase.

 I thought to try leiningen hooks but as far as I can see this is only
 possible within a plugin; so I have tried this...

 (defproject take-wing 0.1.0-SNAPSHOT
   :dependencies [[org.clojure/clojure 1.6.0]
  [uk.org.russet/tawny-owl 1.1.1-SNAPSHOT]]

   :hooks [take.build.gensource]
   )


 where take.build.gensource is defined in the src directory of the
 project (most of the rest of this directory will be generated).

 Error: cannot resolve take.build.gensource/activate hook
 Error: cannot resolve take.build.gensource/activate hook

 The take/build/gensource.clj file exists and it has an activate
 function.

 I am guessing that this is failing because leiningen is not looking in
 the project source-path, only it's own classpath. I'm a bit reticient to
 write a leiningen plugin for this as a) it would be entirely specific to
 this project and b) it would make the build more complex (AFAIK I'd have
 to do a pre-build for the plugin, then another for the actual project)
 and c) is a pain for anyone else.

 So, should hooks work under these circumstances? Or must I go the plugin
 route?

 Phil

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


Re: leiningen project hooks

2014-06-24 Thread Jason Felice
I didn't think of that.  In my case, it was in a plugin.  I bet it would
work if you set :eval-in-leiningen to true.

Plugins are also pretty easy to write.

I'm not sure you need the lien exec plugin...  an alias for [run -m
foo.bar/baz]?




On Tue, Jun 24, 2014 at 12:03 PM, Phillip Lord phillip.l...@newcastle.ac.uk
 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 be a bit slicker if possible.

 Phil

 Jason Felice jason.m.fel...@gmail.com writes:

  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 20, 2014 at 4:06 AM, Phillip Lord 
 phillip.l...@newcastle.ac.uk
  wrote:
 
 
 
  I've been struggling with leiningen project hooks as I believe that I
  need them for my current project.
 
  I am writing an manual with code examples, using a literate programming
  technology. The main source is in asciidoc, but I can untangle these to
  produce valid clojure, which I can then evaluate and test.
 
  To do this, however, I need to run an external process to generate the
  source -- i.e. the Clojure files which are not really source in this
  case, before I try to load them and test the functions in them. In
  Maven, I can do this with the exec plugin by attaching to the initialize
  phase.
 
  I thought to try leiningen hooks but as far as I can see this is only
  possible within a plugin; so I have tried this...
 
  (defproject take-wing 0.1.0-SNAPSHOT
:dependencies [[org.clojure/clojure 1.6.0]
   [uk.org.russet/tawny-owl 1.1.1-SNAPSHOT]]
 
:hooks [take.build.gensource]
)
 
 
  where take.build.gensource is defined in the src directory of the
  project (most of the rest of this directory will be generated).
 
  Error: cannot resolve take.build.gensource/activate hook
  Error: cannot resolve take.build.gensource/activate hook
 
  The take/build/gensource.clj file exists and it has an activate
  function.
 
  I am guessing that this is failing because leiningen is not looking in
  the project source-path, only it's own classpath. I'm a bit reticient to
  write a leiningen plugin for this as a) it would be entirely specific to
  this project and b) it would make the build more complex (AFAIK I'd have
  to do a pre-build for the plugin, then another for the actual project)
  and c) is a pain for anyone else.
 
  So, should hooks work under these circumstances? Or must I go the plugin
  route?
 
  Phil
 
  --
  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.
 

 --
 Phillip Lord,   Phone: +44 (0) 191 222 7827
 Lecturer in Bioinformatics, Email:
 phillip.l...@newcastle.ac.uk
 School of Computing Science,
 http://homepages.cs.ncl.ac.uk/phillip.lord
 Room 914 Claremont Tower,   skype: russet_apples
 Newcastle University,   twitter: phillord
 NE1 7RU

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

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 dave.te...@gmail.com wrote:

 What is the commonly accepted technique for declaring/using 'supplied-p'
 type lambda list functionality in clojure?


 http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_3-4-1.html


 I have some clojure functions with a large number of keywords and various
 defaults, I want to know if a keyword was specified by the caller (rather
 than defaulted) in some cases.

 Certainly I could implement my own destructuring macros that did this, but
 I'd like to avoid reinventing a wheel here if I can, and also to know the
 idiomatic clojure way to do it.

 Thanks for any tips.


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


[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.
https://github.com/maitria/packthread/blob/master/README.md#whyWhy?

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 problem, we need to pass around *all*the application's
state. And that's just too hard, and it's basically just like having all
the global variables anyway, and you've coupled every function in the
system to this big ball of mud. So we need to separate it out and
encapsulate and therefore we've invented $library which does *x*, where *x* ∈
{*OO programming*, *global mutable state*, *...*}.

Packthread is for threading state through programs in a simple, composable
way. It does not compromise the ability to be functionally pure or reason
about one's program. It's pretty similar to the - and - macros, with a
helper macro named in for creating different *projections* of the state to
manipulate with different functions.
https://github.com/maitria/packthread/blob/master/README.md#+

Threads value through forms in much the same way as -, except for special
handling of the following forms:
https://github.com/maitria/packthread/blob/master/README.md#if-if-not-if-let-when-when-not-when-letif,
if-not, if-let, when, when-not, when-let:

The value is threaded through the then and else clauses independently,
leaving the test conditions alone. If an else clause is missing, it is will
be supplied as though the value had been threaded through identity in that
case.

For example,

(+ 42 (if true inc)) ;= 43(+ 42 (if false inc)) ;= 42

In when, when-not, and when-let forms, the value is threaded through each
form in the body, not just the last.
https://github.com/maitria/packthread/blob/master/README.md#condcond

The test clauses are left untouched and the value is threaded through the
expr clauses of each condition. If no :else condition was supplied, + pretends
as though it has been (identity), and threads the value through that.

For example,

(+ 42
  (cond
(= 1 2)
inc)) ;= 42
(+ 42
  (cond
(= 1 1)
dec)) ;= 41

https://github.com/maitria/packthread/blob/master/README.md#dodo

The current expr is threaded through the body forms of the do.
https://github.com/maitria/packthread/blob/master/README.md#letlet

The current expression is threaded through the body of the let form, with
the bindings in place. For example:

(+ 42
  (let [x 1]
(+ x))) ;= 43

https://github.com/maitria/packthread/blob/master/README.md#trytry

The current expression is threaded through the body of the try form. The
*same* value is threaded through each catch clause. Anyfinally clauses are
left alone.

(+ 42 (try
 inc
 (catch Exception e
   dec)) ;= 43
(+ 42 (try
 (+ :foo)
 (catch Exception e
   dec))) ;= 41
(+ 42 (try
 inc
 (finally dec))) ;= 42

https://github.com/maitria/packthread/blob/master/README.md#inin

Threads the inner expressions through a projection of value.

projector is a function which takes two arguments: a value and a function.
It should apply the function to a *projection* of the value, take the
function's result, and reassemble from that result a value which can be
used again in the outer context.

For example,

(+ 42
(in (fn [v f]
  (* 2 (f (/ v 2
  inc)) ;= 42.5

This can be thought of as 'lifting' the body expressions into the 'world
where things are twice as large'.

As a special case, if projector is a keyword, in assumes that value is a
map and that sub-key are threaded through the inner expressions.

For example,

(+ {:hello 42}
(in :hello
  (+ 5))) ;= {:hello 47}

This macro can only be used inside + or +.
https://github.com/maitria/packthread/blob/master/README.md#-1+

Threads expressions like -, except with the handling of the special forms
above.
https://github.com/maitria/packthread/blob/master/README.md#installing
Installing

Leiningen http://github.com/technomancy/leiningen/ dependency information:

[com.maitria/packthread 0.1.1]

https://github.com/maitria/packthread/blob/master/README.md#usageUsage

(require '[packthread.core :refer :all])
(+ 42
(if true
  inc)) ;= 43

See core_test.clj
https://github.com/maitria/packthread/blob/master/test/packthread/core_test.clj
for
examples of usage.
https://github.com/maitria/packthread/blob/master/README.md#licenseLicense

Copyright 2014 Maitria

You have permission to use this in any way you like (modify it, sell it,
republish it), provided you agree to all the following conditions:

   - you don't mislead anyone about it
   - you don't interfere with our ability to use it
   - you release us from any claims of liability if it causes problems for
   you

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note 

[ANN] Avi 0.1.4

2014-06-05 Thread Jason Felice
This is the it lives! version.  It's still not pleasant to use, but you
can use it to code!

Since last we met: i,o,O,a,A,:w,:wq,:q!
avi

A lively vi.
https://github.com/maitria/avi/blob/master/README.md#visionVision

We love vim. We want more! Test coverage. Flexibilty. Live REPLs!
https://github.com/maitria/avi/blob/master/README.md#guiding-principlesGuiding
Principles

   - Test driven. All functionality covered by tests.
   - Don't defeat vim muscle memory.
   - Code is for people. Be expressive as hell.
   - Be friendly. Especially to noobs.

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 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/eraserhd - or gchat.
https://github.com/maitria/avi/blob/master/README.md#statusStatus

Our intention is for the unit tests to provide friendly documention of
what's been implemented so far. To run the unit tests with verbose output,
use

$ lein midje :print-facts

https://github.com/maitria/avi/blob/master/README.md#installingInstalling

   - Works with Leiningen 2.3.4
   - On Linux, ncurses-dev or curses-dev or equivalent must be installed.

$ git clone https://github.com/maitria/avi.git
$ cd avi
$ lein install

On Linux, you'll likely not have access to /usr/local. In that case you'll
need to use sudo lein install instead.
https://github.com/maitria/avi/blob/master/README.md#licenseLicense

Copyright 2014 Maitria

You have permission to use this in any way you like (modify it, sell it,
republish it), provided you agree to all the following conditions:

   - you don't mislead anyone about it
   - you don't interfere with our ability to use it
   - you release us from any claims of liability if it causes problems for
   you

-- 
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: 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 pedal hits the road for performance, I'll try to rephrase it.

If you can phrase things in terms of (catvec (subvec ...) (subvec ...)),
then I'll bet (but you should check) that rrb-vector will perform better
and do more structural sharing.



On Wed, Jun 4, 2014 at 8:29 AM, Paul Butcher p...@paulbutcher.com wrote:

 I am working with “sequence like” trees - by which I mean that they’re
 very broad (typically the root node will have several thousand children)
 and shallow (no more than 2 levels deep). I’m often dealing with a
 degenerate tree that’s really just a sequence (all the nodes in the tree
 are children of the root).

 A typical edit is either changing the value of a single element, inserting
 a single element, or deleting a small set of contiguous elements.

 I’m currently using clojure.zip to edit the tree, and it’s working just
 fine. But I’m concerned that it won’t be giving me much value in terms of
 structure sharing for this type of tree and this type of edit.

 So I have two questions:

 1) What would be a good way for me to instrument my code to determine what
 level of structure sharing I am achieving?

 2) Should I consider switching to something based on (say?) rrb-vector?

 --
 paul.butcher-msgCount++

 Silverstone, Brands Hatch, Donington Park...
 Who says I have a one track mind?

 http://www.paulbutcher.com/
 LinkedIn: http://www.linkedin.com/in/paulbutcher
 Skype: paulrabutcher

 Author of Seven Concurrency Models in Seven Weeks: When Threads Unravel
 http://pragprog.com/book/pb7con

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


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
colin.mailingl...@gmail.comwrote:

 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 using state charts for networked apps:
 http://www.zedshaw.com/essays/ragel_state_charts.html. I read an article
 (or an interview, I can't remember) where he discussed the state machines
 in Mongrel in more depth, it was fascinating and quite amazing how much it
 simplified the code, made it much more robust and consistently handled
 tricky corners of HTTP while easily supporting things like websockets.

 I'll take a look when I get a moment and provide some feedback - in
 particular I'm excited about the possibility of compiling state machines
 without the build time precompile step, I think there are a lot of
 interesting possibilities with this.

 Cheers,
 Colin


 On 14 May 2014 07:27, Zach Tellman ztell...@gmail.com wrote:

 https://github.com/ztellman/automat

 This has been languishing in my Github for a while, for lack of a few
 finishing touches on the code and documentation.  I think this is one of
 cooler libraries I've written, and beyond the obvious use for parsers, the
 set theoretic operators could be a powerful way to specify actions in
 response to complex browsing behaviors on a site, or any other number of
 things.  I'm excited to see how it's used.

 I'm happy to answer any questions.  Suggestions on how to improve the
 documentation are encouraged.

 Zach

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


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 jozef.wag...@gmail.com 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.com/LonoCloud/synthread
 [2] http://www.infoq.com/presentations/Macros-Monads

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


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 rbar...@gmail.com 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 the project.clj file to :

 (defproject sat4j-app 0.1.0-SNAPSHOT
   :description FIXME: write description
   :url http://example.com/FIXME;
   :license {:name Eclipse Public License
 :url http://www.eclipse.org/legal/epl-v10.html}
   :dependencies [
  [org.clojure/clojure 1.5.1]
  [org.ow2.sat4j/org.ow2.sat4j.sat 2.3.5]
  [org.ow2.sat4j/org.ow2.sat4j.core 2.3.5]
  ]
   :main sat4j-app.core
   :profiles {:uberjar {:aot :all}})

 If I run lein deps, I can see that leiningen can find the sta4j modules :
 
 Retrieving
 org/ow2/sat4j/org.ow2.sat4j.sat/2.3.5/org.ow2.sat4j.sat-2.3.5.pom from
 central
 Retrieving
 org/ow2/sat4j/org.ow2.sat4j.pom/2.3.5/org.ow2.sat4j.pom-2.3.5.pom from
 central
 Retrieving org/ow2/ow2/1.5/ow2-1.5.pom from central
 Retrieving
 org/ow2/sat4j/org.ow2.sat4j.core/2.3.5/org.ow2.sat4j.core-2.3.5.pom from
 central
 

 And I can compile and run the default code (no sat4j import yet).
 The problem occurs when I try to use import in my main clojure code :

 (ns sat4j-app.core
   (:gen-class)
   (:import org.ow2.sat4j/org.ow2.sat4j.core Vec ))

 I then get a Class not found exception (Vec is suppoed to be defined in
 the core module)
 I don't know which syntax to use in the import statement.
 I've also tried (:import org.ow2.sat4j.core Vec ), (:import
 org.ow2.sat4j.core.Vec ) without success.

 To make think even more confusing, I did a local build of sat4j and I
 found (using javadoc html page) that the Vec class is defined as
 org.sat4j.core.VecT
 not org.ow2.sat4j.core.VecT.
 So I tried (:import org.sat4j.core.Vec ) and (:import org.sat4j.core Vec
 ) without success.

 Any clue ?


 Thank you


 Ronan










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


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 ja...@booleanknot.com wrote:

 The non-standard license might make using this library difficult to use
 for some companies. You may want to consider using an existing open source
 license that's broadly similar, such as MIT.

 - James


 On 2 May 2014 09:00, Fabien Todescato fabien.todesc...@gmail.com wrote:

 Thanks for that great work ! Reminds me of similar techniques in the
 context of logic programming : http://www.info.ucl.ac.be/~pvr/edcg.html:)

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


[ANN] packthread 0.1.0

2014-04-30 Thread Jason Felice
packthread

Threading macros for working with globs of state.
https://github.com/maitria/packthread/blob/master/README.md#whyWhy?

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 problem, we need to pass around *all*the application's
state. And that's just too hard, and it's basically just like having all
the global variables anyway, and you've coupled every function in the
system to this big ball of mud. So we need to separate it out and
encapsulate and therefore we've invented $library which does *x*, where *x* ∈
{*OO programming*, *global mutable state*, *...*}.

Packthread is different.

Packthread is for threading state through programs in a simple, composable
way. It does not compromise the ability to be functionally pure or reason
about one's program. It's pretty similar to the - and - macros, with a
helper macro named in for creating different *projections* of the state to
manipulate with different functions.
https://github.com/maitria/packthread/blob/master/README.md#+

Threads value through forms in much the same way as -, except for special
handling of the following forms:
https://github.com/maitria/packthread/blob/master/README.md#if-if-not-if-let-when-when-not-when-letif,
if-not, if-let, when, when-not, when-let:

The value is threaded through the then and else clauses independently,
leaving the test conditions alone. If an else clause is missing, it is will
be supplied as though the value had been threaded through identity in that
case.

For example,

(+ 42 (if true inc)) ;= 43(+ 42 (if false inc)) ;= 42

In when, when-not, and when-let forms, the value is threaded through each
form in the body, not just the last.
https://github.com/maitria/packthread/blob/master/README.md#condcond

The test clauses are left untouched and the value is threaded through the
expr clauses of each condition. If no :else condition was supplied, + pretends
as though it has been (identity), and threads the value through that.

For example,

(+ 42
  (cond
(= 1 2)
inc)) ;= 42
(+ 42
  (cond
(= 1 1)
dec)) ;= 41

https://github.com/maitria/packthread/blob/master/README.md#dodo

The current expr is threaded through the body forms of the do.
https://github.com/maitria/packthread/blob/master/README.md#inin

Threads the inner expressions through a projection of value.

projector is a function which takes two arguments: a value and a function.
It should apply the function to a *projection* of the value, take the
function's result, and reassemble from that result a value which can be
used again in the outer context.

For example,

(+ 42
(in (fn [v f]
  (* 2 (f (/ v 2
  inc)) ;= 42.5

This can be thought of as 'lifting' the body expressions into the 'world
where things are twice as large'.

As a special case, if projector is a keyword, in assumes that value is a
map and that sub-key are threaded through the inner expressions.

For example,

(+ {:hello 42}
(in :hello
  (+ 5))) ;= {:hello 47}

This macro can only be used inside + or +.
https://github.com/maitria/packthread/blob/master/README.md#-1+

Threads expressions like -, except with the handling of the special forms
above.
https://github.com/maitria/packthread/blob/master/README.md#installing
Installing

Leiningen http://github.com/technomancy/leiningen/ dependency information:

[com.maitria/packthread 0.1.0]

https://github.com/maitria/packthread/blob/master/README.md#usageUsage

(require '[packthread.core :refer :all])
(+ 42
(if true
  inc)) ;= 43

See 
core_test.cljhttps://github.com/maitria/packthread/blob/master/test/packthread/core_test.clj
for
examples of usage.
https://github.com/maitria/packthread/blob/master/README.md#licenseLicense

Copyright 2014 Maitria

You have permission to use this in any way you like (modify it, sell it,
republish it), provided you agree to all the following conditions:

   - you don't mislead anyone about it
   - you don't interfere with our ability to use it
   - you release us from any claims of liability if it causes problems for
   you

-- 
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: 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, put them in a separate file).  I've reminded people that the SRP
(any piece of code should have one reason to change) implies the
converse, which I phrase as Code which changes together, stays together.

That said, I like the idea of more structured documentation.  (Possibly
including test cases!  Python has test runners which verify examples in doc
strings, for example.)
On Apr 26, 2014 4:31 PM, Gary Trakhman gary.trakh...@gmail.com wrote:

 This is a lovely idea.

 I think prismatic schema is one well-accepted way to document data shapes,
 but it's expected to be used inline. It would be nice to have flexibility
 in what description systems are used in addition to flexibility of where
 the docs live.

 I agree that being able to see and reason about bare code with no hassle
 is a (personal) demotivator for documentation, but where the docs live
 should be up to the implementor.  Having a code-based system means we can
 use and improve existing runtime tooling to navigate and interact with it.
  This would make a great cider middleware :-).

 On Saturday, April 26, 2014, Val Waeselynck val.vval...@gmail.com wrote:

 Hello to all,

 *Short version :* I think Clojure needs a documentation system in
 Clojure, I would like to know if some efforts exist in that direction, and
 I am willing to create it / contribute to it.

 *Long version :*

 I've been thinking for a while that the Clojure community could benefit a
 lot from a more sophisticated and ergonomic documentation system.

 I have seen some existing plugins like lein-sphinx, but I think it would
 be really good to have documentation that would be written in Clojure, for
 the following reasons :

- we're all very fond of Clojure data structures and their syntax. (I
don't know about you, but I find that even HTML looks better in
Clojure https://github.com/weavejester/hiccup than in HTML). Plus,
Clojure programmers already know how to edit them.
- (better reason) The facts that Vars are first-class citizens and
that symbols can be referred explicitly with hardly any ceremony (macros)
are a exceptional opportunity to make smart and highly-structured
documentation very easily.
- if it's in Clojure, Clojure programmers can seamlessly build *ad
hoc* documentation functionality on top of it to suit their own
particular needs.

 I haven't found anything of the like yet, and if it exists, I would be
 grateful if someone would redirect me to it.

 Here are *my thoughts on this :*

1. Clojure doc-strings, although they are quite handy as reminders
and for doc-indexation, are *too raw a content*. Even when they are
done right, they tend to be cumbersome, and it's too bad to have such
concise code drown in the middle of so much documentation. What's more, I
believe that when programmers program a function (or anything), they tend
to think more about the implementation than the (uninformed) usage, so 
 they
have little incentive to make it right.
2. Building on 1. having a system where documentation and programs
live in separate files, in the same way as tests, would enforce a healthy
separation of concerns. Importantly, it would make life much easier on the
Version Control perspective.
3. Documentation should probably be made differently than what people
have got accustomed to by classical languages. Because you seldom find
types, and because IMHO Clojure programs are formed more by factoring out
recurring mechanisms in code than from implementing intellectual
abstractions, the relevant concepts tend not to be obvious in the code.
Since in Clojure we program with verbs, not 
 nounshttp://steve-yegge.blogspot.fr/2006/03/execution-in-kingdom-of-nouns.html,
I think *documentation is best made by example*.
4. Documentation of a Var should not be a formal description of what
it is and what it does with some cryptically-named variables. *Every
bit of documentation should be a micro-tutorial*. Emphasis should be
put on usage, examples, tips, pitfalls, howtos.
5. There should be structure in the documentation, and it shouldn't
be just :see-also links - *there should be semantics* in it.  For
example, some functions/macros are really meant to be nothing but
shorthands for calling other functions : that kind of relationship should
be explicitly documented.
6. Documentation should not be just information about each separate
Var in a namespace. There should be a hierarchy to make the most useful
elements of an API more obvious. Also, adding cross-vars documentation
elements such as tags and topics could make it easier 

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 remember write-only code being coined).
 I've seen it with Scheme, Lua, and JavaScript as well.  Some people see it
as a flaw of the language, but it's actually the flexibility of the
language that allows it.

And that's why many people have said things like this: Write your code
_first_ for people to read. You needn't worry about the compiler, it will
have much less trouble understanding it than the people if it's correct.
 (That's my phrasing.)

So, I wouldn't call code elegant if _you_ have trouble reading it when
you come back to it.  The algorithm could be elegant, but not the code.
 This is just how I use the word, though... I don't get to define it.

 Though it's possible to write flatter more linear, more readable, more
maintainable code, I didn't really want to, and ...

What you wrote sounds to me very much like, I had some pain, and I learned
that what I did caused the pain, and I figured out how to fix the pain...
but I'd rather not  That *apparent* contradiction suggests to me that you
skipped the important part about what you really like about that, and I'm
very curious... Why didn't you want to write the easier-to-read code?

-Jason

-- 
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: 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 guaranteed, the reader
would need to store the map entries in an intermediate form and decide when
it gets to the end whether it becomes a map or a macro call.

There's nothing special about curly braces in terms of being able to read
math - in fact, parentheses make more sense.  So a macro in position one of
a list seems like a much better answer.  Even if you'd like to avoid
spelling out a macro name like infix, you could make it i, and this
handles unary operators:

(infix 2 + 4 * - x)

-- 
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: 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 g...@dolber.com wrote:

 Is there a better way to achieve this?

 https://gist.github.com/galdolber/9946533

 Thanks!

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


[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.
https://github.com/maitria/avi#visionVision

We love vim. We want more! Test coverage. Flexibilty. Live REPLs!
https://github.com/maitria/avi#guiding-principlesGuiding Principles

   - Test driven. All functionality covered by tests.
   - Don't defeat vim muscle memory.
   - Code is for people. Be expressive as hell.
   - Be friendly. Especially to noobs.

-- 
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: 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
managable without worrying about things  behaviors.

(I say this knowing that there are a dozen conflicting notions of BDD.)


On Tue, Mar 25, 2014 at 9:43 AM, Gilberto Garcia giba@gmail.com wrote:

  Hi Marcus,

 I'm also starting with Clojure and would like to find someone to pair and
 to study Clojure together.

 Best regards,
 Gilberto



 On 03/25/2014 09:50 AM, Marc Bluemner wrote:

 Hey Marcus,

  Im Marc from Germany! Im actualy learning Clojure and am trying to get
 good at BDD, we are trying to implement it at work so practice would be
 great. I must say Ive never done pair programming but Im realy eager to
 try. SO if you like Im absolutly open for everything.

  Greetings Marc

 Am Mittwoch, 30. Oktober 2013 04:43:54 UTC+1 schrieb Marcus Blankenship:

 Hi Folks,

  I'm a Clojure n00b, but am interested in finding another n00b who
 aspires to learn Clojure, and do so using BDD / TDD practices through
 regular pairing sessions.  I've found novice - novice pairing to be a
 great way to ramp up on skills, but I don't live near anyone who I can pair
 with.

  I'm thinking that doing 3 1-hour sessions a week, for a month, would
 give us a nice start.  Obviously, this would be remote pairing via
 ScreenHero (or some other tool).

  Anyone interested?

  Best,
 Marcus


 marcus blankenship
 \\\ Partner, Problem Solver, Linear Thinker
 \\\ 541.805.2736 \ @justzeros \ skype:marcuscreo

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


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?




On Tue, Mar 18, 2014 at 11:25 AM, Laurens Van Houtven _...@lvh.cc wrote:

 Hi,


 On Tuesday, March 18, 2014 3:02:01 PM UTC+1, Paul deGrandis wrote:

 I've written general versions of Blossom and Blossom V in the past, and
 every so often a similar question comes up on this mailing list.


 I'm guessing that wasn't in clojure? :-(

 Do you happen to know what happens when you throw Blossom V at a graph
 that doesn't have a perfect matching? E.g. for my use case, hotel room
 pairing, there's a 1/2 chance the graph ends up having an odd number of
 nodes... IIUC it won't terminate, but you can detect that it won't, so then
 you can just give the best-effort solution anyway?


 I'd personally love to see both algorithms contributed to Loom if OP is
 up for the task.


 I'm afraid I've got a convex optimization problem in terms of financial
 aid grant sizes to solve first before I can start writing that code :-)

 cheers
 lvh

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


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 milinda.pathir...@gmail.comwrote:

 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]
(work {}
  (let [tuple (pop)
words (s/split (value-at tuple 0)  )]
(doseq [w words]
 (push [w] :anchor tuple)

 I need to transform above work section to something looks like following.

 (work [tuple1234]
(let [tuple tuple1234
   words (s/split (value-at tuple 0)  )]
  (doseq [w words]
 (push [w] :anchor tuple

 (pop) should be replaced by tuple1234 like string which is same as
 parameter to work function.

 Really appriciate if someone can point me a way to achieve this. I am not
 sure having pop as another macro is viable because I need to use the same
 name as input parameter to work function.

 Thanks
 Milinda

 --
 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/groups/opt_out.


-- 
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/groups/opt_out.


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 wdlas...@gmail.com wrote:

 I'm comparing two large files based on specific fields in the files. Is
 there a functional way of accumulating the results without atoms? (And
 since I'm a newbie, any other advice is appreciated!)

 (let [sun (atom []) fri (atom [])]
   (with-open [rdr (clojure.java.io/reader /dev/errors-sunday.csv)]
 (doseq [line (line-seq rdr)]
   (when (re-matches #^[^,]+,[^,]+,FAIL,.*$ line)
 (swap! sun conj (nth (string/split line #,) 1)
   (with-open [rdr (clojure.java.io/reader /dev/errors-friday.csv)]
 (doseq [line (line-seq rdr)]
   (when (re-matches #^[^,]+,[^,]+,FAIL,.*$ line)
 (swap! fri conj (nth (string/split line #,) 1)
   (println (nth (data/diff (set @fri) (set @sun)) 1))
   )

 Thanks,
 Dean

 --
 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/groups/opt_out.


-- 
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/groups/opt_out.


Re: Accumulate results without state?

2014-03-04 Thread Jason Felice
Your welcome!

I just realized that, in this case, filter and map are good enough, but the
general answer for threading state through the processing of a sequence is
to use `reduce`.  Coming from another language, it takes a while to realize
how often the answer is to use reduce.

-Jason


On Tue, Mar 4, 2014 at 4:07 PM, Dean Laskin wdlas...@gmail.com 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/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 wdla...@gmail.com wrote:

 I'm comparing two large files based on specific fields in the files. Is
 there a functional way of accumulating the results without atoms? (And
 since I'm a newbie, any other advice is appreciated!)

 (let [sun (atom []) fri (atom [])]
   (with-open [rdr (clojure.java.io/reader /dev/errors-sunday.csv)]
 (doseq [line (line-seq rdr)]
   (when (re-matches #^[^,]+,[^,]+,FAIL,.*$ line)
 (swap! sun conj (nth (string/split line #,) 1)
   (with-open [rdr (clojure.java.io/reader /dev/errors-friday.csv)]
 (doseq [line (line-seq rdr)]
   (when (re-matches #^[^,]+,[^,]+,FAIL,.*$ line)
 (swap! fri conj (nth (string/split line #,) 1)
   (println (nth (data/diff (set @fri) (set @sun)) 1))
   )

 Thanks,
 Dean

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@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+u...@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+u...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.


  --
 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/groups/opt_out.


-- 
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/groups/opt_out.


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

2014-03-03 Thread Jason Felice
Hi!

@Gaofeng, I've started working on Linux support and should have it finished
soon.

@Ambrose, will do soon.

Thanks!


On Sun, Mar 2, 2014 at 12:50 AM, Gaofeng Zeng ndtm.i...@gmail.com wrote:

 Hi Jason, Angela
 It is cool, but it not support linux. I modify the avi.install to make it
 support linux.


 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 terminal writing,
 installation, booting the JVM).

 It currently supports h,j,k,l,^E,^Y,$,^,0,G,:q and command repeat counts.

 *Vision*

 A lively vi with support for incremental compilation, deep language
 integration and source navigation, realtime shells and REPLs, and plugins,
 written so *it* can be a plugin in other IDEs.

 *Guiding Principles*


- Test driven.  All functionality covered by tests.
- Don't defeat vim muscle memory.
- Code is for people.  Be expressive as hell.
- Be friendly.  Especially to noobs.


 Thanks!  We'd love to hear any and all feedback.

 -Jason  Angela

  --
 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/groups/opt_out.


-- 
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/groups/opt_out.


[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 lively vi with support for incremental compilation, deep language
integration and source navigation, realtime shells and REPLs, and plugins,
written so *it* can be a plugin in other IDEs.

*Guiding Principles*


   - Test driven.  All functionality covered by tests.
   - Don't defeat vim muscle memory.
   - Code is for people.  Be expressive as hell.
   - Be friendly.  Especially to noobs.


Thanks!  We'd love to hear any and all feedback.

-Jason  Angela

-- 
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/groups/opt_out.


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 gagliardi.cur...@gmail.com
wrote:

 Hey everyone, I just wanted to get some feedback on whether or not this is
 a good idea.  I've seen clj-refactor.el recommended a decent amount, but as
 a dyed-in-the-wool take-no-prisoners vim user, I can't use it.  I've always
 thought it was weird that refactoring was so tightly coupled to editors and
 IDEs, so I thought I'd try writing some refactors as an nrepl middleware,
 that would ideally be able to be used across editors.  I've only
 re-implemented the threading and some of the cycling refactors from
 clj-refactor.el, but it's to the point where I'm going to investigate
 actually integrating with vim or light table.  I've never written any
 plugins for either of these editors so I might discover there are good
 reasons I haven't seen refactoring done as a client/server type thing.
 Anyway, the code is here: https://github.com/cgag/nrepl-refactor , if
 anyone has any has any feedback I'd love to hear it, and if anyone has
 vimscript or lighttable plugin experience and wants to help, that'd be
 great as well.

 Curtis

 --
 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/groups/opt_out.


-- 
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/groups/opt_out.


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, Aravindh S aravi...@theintrospect.inwrote:

 Hi All,
 I am new to clojure and have been working with the language for the
 past one week. I have got a basic hold of the constructs in clojure. I have
 been programming for 4 years in C# now. One thing I am not able to
 comprehend is how clojure programs are structured. In an OO world, I know
 what are the entities that the program should have, how they will be
 related etc. I am not able to do the same wit clojure. I agree that words
 like classes, methods dont make much sense in functional programming. I am
 precisely looking for a program written in clojure ( A medium level program
 say about 200 - 300 LOC) which clearly tells how a problem domain should be
 approached in a functional manner using clojure, how the functions should
 be organized. A specific solution for specific problem will be helpful.


 Thanks
 Aravindh.S

 --
 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/groups/opt_out.


-- 
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/groups/opt_out.