Re: Curious behaviour when requiring clojure.tools.cli

2021-06-14 Thread Simon Brooke
project.clj? > > See > https://github.com/clojure/clojure/blob/b1b88dd25373a86e41310a525a21b497799dbbf2/src/clj/clojure/string.clj#L362 > > What exactly else is going on I don't know but it all starts from the > wrong Clojure version. > > HTH > > On Monday, June 1

Curious behaviour when requiring clojure.tools.cli

2021-06-14 Thread Simon Brooke
ls/cli.cljc:97:8) In case anyone's interested, my current diff with respect to weavejester's current codox is here: https://github.com/simon-brooke/codox/commit/ef4ba70659c768f1aab4bfbf32efdaa48e9c43a8 Thanks in advance for any help or thoughts! -- You received this message because you are sub

Re: Bit rot and leiningen?

2020-02-06 Thread 'Simon Brooke' via Clojure
On Wednesday, 5 February 2020 22:34:42 UTC, Sean Corfield wrote: > > > because I still haven't found a development environment I like better > than LightTable > > > > Have you looked at Atom/Chlorine recently? It has the same inline result > display that LightTable had, it has a built-in Cloj

Re: Bit rot and leiningen?

2020-02-05 Thread 'Simon Brooke' via Clojure
On Wednesday, 5 February 2020 09:59:25 UTC, Simon Brooke wrote: > > On Tuesday, 4 February 2020 15:56:47 UTC, James Reeves wrote: >> >> This may be due to the plugins overriding a dependency that Leiningen >> itself needs. There was an issue like this >> <ht

Re: Bit rot and leiningen?

2020-02-05 Thread &#x27;Simon Brooke' via Clojure
On Tuesday, 4 February 2020 15:56:47 UTC, James Reeves wrote: > > This may be due to the plugins overriding a dependency that Leiningen > itself needs. There was an issue like this > logged with > Lein-Ring, which I notice you're using. Try

Bit rot and leiningen?

2020-02-04 Thread &#x27;Simon Brooke' via Clojure
Hi all I recently wanted to do some work on a project of mine I've not worked on for more than a year, and found to my great surprise that it will no longer build. Full details of the bug are here , but the core seems to be: clojure.lang.Com

Re: Re-frame - on-click handler doesn't work, and I can't understand why not

2018-08-28 Thread &#x27;Simon Brooke' via Clojure
Thanks, yes, that was part of the problem. The other part was failing to deref the atom. D'oh! On Tuesday, 28 August 2018 17:16:00 UTC+1, Matching Socks wrote: > > Did you intend to pass a function-that-returns-a-function instead of just > a function as the handler? Also, it is a bit odd (maybe

Re-frame - on-click handler doesn't work, and I can't understand why not

2018-08-28 Thread &#x27;Simon Brooke' via Clojure
Hi, I'm stuck... Consider this function <https://github.com/simon-brooke/youyesyet/blob/feature/reflow-app/src/cljs/youyesyet/canvasser_app/ui_utils.cljs#L46> : (defn big-link [text & {:keys [target handler]}] (js/console.log (str "Big link with target '"

Re: Automatically upversioning a project in continuous integration?

2016-06-14 Thread &#x27;Simon Brooke' via Clojure
Many thanks, googling 'leiningen release tasks' has certainly found me interesting things to read and digest. On Tuesday, 14 June 2016 12:35:57 UTC+1, Alex Miller wrote: > > > > On Tuesday, June 14, 2016 at 5:21:04 AM UTC-5, Simon Brooke wrote: >> >> Apologi

Automatically upversioning a project in continuous integration?

2016-06-14 Thread &#x27;Simon Brooke' via Clojure
Apologies if this is a FAQ, I have done a number of searches and not found anything. I see that the Clojure project's internal Hudson CI server does automatic upversioning on release builds (see documentation here ). It doesn't, ho

Re: Removing duplicates from a series

2016-05-17 Thread &#x27;Simon Brooke' via Clojure
[series] (map last (partition-by get-value-for-event series))) Note last instead of first because I needed the earliest event in each value group. I also very much liked Fluid Dynamics response. I'm really grateful to you all, this gets me out of a hole! On Tuesday, 17 May 2016 10:47:06

Re: Removing duplicates from a series

2016-05-17 Thread &#x27;Simon Brooke' via Clojure
changed. You could also assemble a > transducer pipeline using the transducer arities of the functions: `(into > [] (comp (partition-by :value) (map first)) events)`. > > Hope that helps, > > Tom > > On Tue, May 17, 2016 at 10:47 AM, 'Simon Brooke' via Clojure

Removing duplicates from a series

2016-05-17 Thread &#x27;Simon Brooke' via Clojure
I'm having trouble with writing a function 1. in idiomatic clojure 2. which doesn't blow the stack The problem is I have a time series of events e.g. ({:idhistory 78758272, :timestamp #inst "2016-03-31T19:34:27.31300-00:00", :nameid 5637, :stringvalue nil, :value 8000.0} {:idhistor

Re: Serialising/deserialising mixed Clojure and Java datastructures

2016-05-10 Thread &#x27;Simon Brooke' via Clojure
On Tuesday, 10 May 2016 10:11:58 UTC+1, Simon Brooke wrote: > > On Monday, 9 May 2016 16:55:59 UTC+1, Alex Miller wrote: >> >> Clojure is designed with enough extensibility to modify the printer and >> reader to cover this case. >> >> You can define a cust

Re: Serialising/deserialising mixed Clojure and Java datastructures

2016-05-10 Thread &#x27;Simon Brooke' via Clojure
On Monday, 9 May 2016 16:55:59 UTC+1, Alex Miller wrote: > > Clojure is designed with enough extensibility to modify the printer and > reader to cover this case. > > You can define a custom print strategy for these types by extending the > print-dup multimethod. If you print it as a tagged litera

Serialising/deserialising mixed Clojure and Java datastructures

2016-05-09 Thread &#x27;Simon Brooke' via Clojure
I'm working on some complex analysis where it takes about twelve hours to construct the model to be analysed. Once it's constructed I'm doing various interactive things to explore it, but I can't currently persist it in a form in which it can be read back in, so that when the REPL session ends i

Re: Can anyone recommend a tutorial or blog post on porting existing Clojure program to ClojureScript?

2015-08-06 Thread Simon Brooke
> Best regards > > On Thu, Aug 6, 2015 at 8:01 AM, Simon Brooke > wrote: > >> Hi >> >> I have an existing Clojure program which is intended for use in classroom >> situations to teach kids about ecology and computer science. You can see it >> in actio

Can anyone recommend a tutorial or blog post on porting existing Clojure program to ClojureScript?

2015-08-06 Thread Simon Brooke
ger maps at once breaks my poor server); source code is here: engine <https://github.com/simon-brooke/mw-engine>, parser <https://github.com/simon-brooke/mw-parser>, user interface <https://github.com/simon-brooke/mw-ui>. The problem with it is that it runs server side, and

Stack overflow while compiling...?

2015-04-14 Thread Simon Brooke
version "0.3.4"})) I get the same error (although, obviously, not quite the same tmp file) when I run at the repl rather than with Gorilla. The stacktrace does not touch any file of mine. The actual file of my own I'm evaluating is this: https://github.com/simon-brooke/mw-explore/b

Re: Given a list of maps, produce a sublist having distinct values for one key

2015-04-06 Thread Simon Brooke
: > > why not just accumulate the interested customers in a set rather than a > seq in the first place? > > On Tue, Mar 24, 2015 at 2:50 PM, Simon Brooke > wrote: > >> I'm rewriting a very odd e-commerce website I first wrote in 1996, for a >> friend. >&g

Given a list of maps, produce a sublist having distinct values for one key

2015-03-24 Thread Simon Brooke
I'm rewriting a very odd e-commerce website I first wrote in 1996, for a friend. The website features categories, which are supposed to be arranged into an acyclic directed graph (actually there are currently cycles in the graph, but there shouldn't be, and that is not the problem I'm trying to

Re: [ANN] Release 0.29.1 of Counterclockwise

2014-11-14 Thread Simon Brooke
Unfortunately your website at http://doc.ccw-ide.org/ appears to be down. On Thursday, 13 November 2014 15:00:52 UTC, Laurent PETIT wrote: > > Counterclockwise, the Eclipse Clojure development tool. > > Counterclockwise 0.29.1

Re: If code is data why do we use text editors?

2014-11-14 Thread Simon Brooke
also wrote a bit of (very simple) code here <https://github.com/simon-brooke/fedit>. The big lisp systems of the past often used in-core editors - the little toy editor I wrote is based on the editor in BBC Lisp, which in turn was based on the editor in Portable Standard Lisp. InterLi

Re: Odd bug, apparently in ring.middleware or clojure.core.memoize?

2014-11-14 Thread Simon Brooke
> profiles.clj. Perhaps you have a plugin that pulls in the core.memoize > 0.5.6 dependency, which causes everything to work. > > The solution to this is to add in an explicit dependency for core.memoize > 0.5.6 in your project file. This will ensure you have the latest version. >

Re: Announcing Smeagol, a very simple wiki engine inspired by Gollum

2014-11-13 Thread Simon Brooke
sday, 11 November 2014 18:00:18 UTC, Simon Brooke wrote: >> >> For a project recently I needed a wiki engine which was simple and easily >> backed up, but which had authentication. I very much liked Gollum >> <https://github.com/gollum/gollum/wiki>, but it does not have

Odd bug, apparently in ring.middleware or clojure.core.memoize?

2014-11-13 Thread Simon Brooke
rom https://github.com/simon-brooke/smeagol.git and then invokes lein repl (or lein ring uberwar, lein ring server, and so on) one gets an odd bug. If one does simple 'lein repl', one gets an error message '#'; if one then does smeagol.repl=> (ns sm

Re: Announcing Smeagol, a very simple wiki engine inspired by Gollum

2014-11-11 Thread Simon Brooke
And now the Git integration does exist and does work. Clojure is such a joy - a complete functional Wiki engine in less than eight hours actual coding! Obviously it's alpha quality, and could definitely be improved, but it works now. On Tuesday, 11 November 2014 18:00:18 UTC, Simon B

Announcing Smeagol, a very simple wiki engine inspired by Gollum

2014-11-11 Thread Simon Brooke
cratch in Clojure than to modify Gollum. So here is Smeagol <https://github.com/simon-brooke/smeagol>. It works now, but the security is pretty crude at this stage and the Git integration which I plan does not yet exist. Feel free to fork or adapt, or just use; any fixes or feedback welco

Re: Having a package visible in the environment in which generated code is compiled?

2014-07-07 Thread Simon Brooke
les, into Clojure source, and then compile it into an anonymous function object, getting round the problem of binding mw-engine.utils in the compiling environment." [rule-text] (do (use 'mw-engine.utils) (eval (parse-rule rule-text This works! On Saturday, 5 J

Having a package visible in the environment in which generated code is compiled?

2014-07-05 Thread Simon Brooke
I am trying to write a domain-specific production rule language which is compiled down at run-time into Clojure code. It's intended that the rule language should be usable by primary school children with little help. So far it's going extremely well, except for one problem. If I run it in the R

Re: every? expected behavior

2014-04-09 Thread Simon Brooke
On Tuesday, 8 April 2014 07:08:56 UTC+1, Jeff Mad wrote: > > Hi, > I am new to Clojure, so please forgive me if this does not make sense. > > I was surprised to find out in the REPL that every? returns true if you > pass in an empty or nil collection. > > user=> (every? #(= 77 %) nil) > > true

Re: How do I detect the end of a file without catching an exception?

2014-04-07 Thread Simon Brooke
Thank you, that's neat! On Monday, 7 April 2014 19:14:40 UTC+1, guns wrote: > > On Mon 7 Apr 2014 at 11:07:37AM -0700, Simon Brooke wrote: > > OK, the second question I've sort of answered for myself, by riffing on > the > > source of line-seq: > > >

Re: How do I detect the end of a file without catching an exception?

2014-04-07 Thread Simon Brooke
(cons expr (lazy-seq (expr-seq src))) (catch RuntimeException eof However, line-seq doesn't bother with catching an exception (presumably because it's not using a PushbackReader). So I come back to my first question: how do I detect the end of a file? On Monday, 7 April 2

How do I detect the end of a file without catching an exception?

2014-04-07 Thread Simon Brooke
I've written a pair of functions which read a stream of Clojure source and identify the var[*] definitions. They work, but the way they work seems clumsy to me. Here they are: (defn find-vars-in-reader [eddi] "Return a list of names of vars declared in the stream this reader reads"

Re: Thoughts on a curly-infix reader macro?

2014-04-07 Thread Simon Brooke
I think this comes down to learning to speak Lisp. Everyone's first few months of learning to speak Lisp are painful. And then quite suddenly it becomes natural. Yes, it's possible to write infix notation for Lisp - I first saw this in InterLisp's CLISP (I think) back in 1985 or so, but it's ol

Re: Leiningen: referring to another project on local disc

2014-04-07 Thread Simon Brooke
Many thanks. This solutions worked for me. I note that it also auto-builds a pom.xml! On Sunday, 6 April 2014 14:31:55 UTC+1, Luc wrote: > > Use lein install > > This command will "install" your testgen jar in your local repo folder. > This local repo is hit first when searching for a dependenc

Leiningen: referring to another project on local disc

2014-04-06 Thread Simon Brooke
I'm trying to reference one of my leiningen projects from another, and not succeeding. My error must be simple and obvious... Essentially the projects 'poker' and 'testgen' are both in /home/simon/workspace, and both are standard leiningen projects using just the default project template. I've

Referential integrity constraints using only clojure.java.jdbc?

2013-12-14 Thread Simon Brooke
First, yes, I now know I could build referential integrity constraints using Korma, and that's almost certainly what I shall do next time. However, I'm quite a long way down building an app against a very tight deadline and I've declared my tables in clojure.java.jdbc, e.g. (defn create-categor

Re: Running Leiningen inside Jenkins CI server

2013-11-01 Thread Simon Brooke
e > lein jar (very possibly > /var/lib/jenkins/.lein/self-installs/leiningen-2.3.3-standalone.jar). You > should be good to go. > > jason > > On Friday, November 1, 2013 1:15:40 PM UTC-7, Simon Brooke wrote: >> >> I've installed Jenkins 1.537 on Debian 6, using To

Running Leiningen inside Jenkins CI server

2013-11-01 Thread Simon Brooke
at I'm getting is as follows: Started by user Simon Brooke <https://www.journeyman.cc/jenkins/user/simon> Building in workspace /var/local/jenkins/workspace/et-clj Cloning the remote Git repository Cloning repository file:///srv/git/et-clj git --version git version 1.7

Re: Reading single characters...?

2013-09-23 Thread Simon Brooke
isabling echo in Unix >> terminals, see >> here<https://github.com/jline/jline2/blob/master/src/main/java/jline/UnixTerminal.java#L89>and >> here<https://github.com/jline/jline2/blob/master/src/main/java/jline/internal/TerminalLineSettings.java#L76> >> . >> &

Reading single characters...?

2013-09-20 Thread Simon Brooke
I've discovered some interesting behaviour - not necessarily a bug, and (if it is a bug) not necessarily a bug in Clojure. Essentially, to emulate a 1970s user interface, I want to read single key strokes from the console. I've found two recipes online, both using the JLine java package: http:

ANN: Proof-of-concept structure editor for Clojure

2013-09-20 Thread Simon Brooke
I'd like to announce fedit, a structure editor for Clojure, is now available on GitHub: https://github.com/simon-brooke/fedit It is experimental, proof of concept code, and has bugs and infelicities. It emulates the Portable Standard Lisp/Cambridge Lisp fedit, a terminal oriented stru

Re: Current 'best practice' stack for CRUD website?

2013-01-21 Thread Simon Brooke
On Sunday, 20 January 2013 11:27:58 UTC, Simon Brooke wrote: > > I've finally cleared other projects from my desk far enough that I'm about > to start trying to reimplement the CRUD part of http://sh.scenehere.info/ in > Clojure. I've been meaning to do this

Re: Current 'best practice' stack for CRUD website?

2013-01-21 Thread Simon Brooke
On Sunday, 20 January 2013 14:55:07 UTC, Shantanu Kumar wrote: > > I really like Enlive, with its very clear separation of logic and > > presentation. Are there any other libraries I should be looking at at > the > > templating layer, or is Enlive currently the one to go for? > > Enlive and Hi

Re: Current 'best practice' stack for CRUD website?

2013-01-21 Thread Simon Brooke
On Sunday, 20 January 2013 21:43:16 UTC, Sean Corfield wrote: > On Sun, Jan 20, 2013 at 3:27 AM, Simon Brooke > > > wrote: > > So I'm looking around at what is the right stack to use to build a CRUD > web > > application in Compojure. > > > &g

Current 'best practice' stack for CRUD website?

2013-01-20 Thread Simon Brooke
I've finally cleared other projects from my desk far enough that I'm about to start trying to reimplement the CRUD part of http://sh.scenehere.info/ in Clojure. I've been meaning to do this for a long time, but paying projects have got in the way. However, it's now urgent because my old Jacquar

Re: Announcement: Vijual Graph Layout Library for Clojure Version 0.1

2010-01-25 Thread Simon Brooke
On 22 Jan, 22:06, Conrad wrote: > http://lisperati.com/vijual/ > > Hope some of you find this library useful. Let me know if you have > feature requests or want to help me improve this library. Many thanks! I shall most certainly use this. -- You received this message because you are subscribed

Re: Correct mapping from Lisp to Clojure?

2010-01-19 Thread Simon Brooke
On 19 Jan, 08:33, Laurent PETIT wrote: > Hello, > > Just one thought, since I also tried to convert some emacs lisp code > to clojure recently ( paredit.el ). > > It seemed a good idea at first, something like : > > 1. I write a one-to-on conversion, using the same idioms that are used > in CL in

Re: Correct mapping from Lisp to Clojure?

2010-01-19 Thread Simon Brooke
On 19 Jan, 06:12, Sean Devlin wrote: > Did you watch Rich's video "Clojure for Lispers"?  That might help > > (The only one I can answer for sure is that Clojure's let is CL's > let*) Ah! that's very handy, I too was wondering how to do a let*! It's certainly expressively useful to have it as t

Cond, and abusing or

2010-01-15 Thread Simon Brooke
There's an old programmers hack that works in many languages of abusing the logical or operator to try a sequence of operations until one returns something useful. It appears that this works in Clojure, too. The reason I tried it is that I'm unhappy with Clojure's implementation of cond. Consider

Re: mutability, threads, state and idiom

2010-01-15 Thread Simon Brooke
On 15 Jan, 17:40, Laurent PETIT wrote: > Simon, > > To be very clear, and incite you to watch all those videos and read > all this material: > > One of the key motivations (if not the primary) of Rich writing > clojure has been constructing a language which would offer built-in > semantics to mana

[im]mutability, threads, state and idiom

2010-01-15 Thread Simon Brooke
Right, I'm trying to get my head around the consequences of immutability for the sort of programming practices I'm used to, and how I change the way I do things to fit in with it. Initially I thought 'well, immutability just means you can't use rplaca and rplacd, and I've very rarely used either so

Re: units.clj - unit conversion functions without repeating yourself

2010-01-14 Thread Simon Brooke
On 14 Jan, 15:49, Scott Jaderholm wrote: > Hi, > > I created a library that provides unit conversion functions[1] for > several common units and allows you to define new units conversions > with a single equation. > > The code is athttp://gist.github.com/276662#file_units.clj > > I'd love to recei

Many foolish questions

2010-01-14 Thread Simon Brooke
OK, I'm trying to get seriously stuck in, and the first thing I'm trying to do is reimplement an inference engine I first wrote in Portable Standard Lisp and then in InterLisp-D in /idiomatic/ Clojure. So please have patience with me... If one has something which is strongly typed, is it idiomatic

Re: making code readable

2008-12-31 Thread Simon Brooke
On Dec 29, 3:15 am, Rich Hickey wrote: > On Dec 28, 8:13 pm, "Mark Volkmann" wrote: > > I'll not argue for making code harder to read, but I have to object to > most of your example. > > Making something 4x longer does not make it easier to read. > > Redundant comments are useless. This is the

Re: In core structure editor, anyone?

2008-12-12 Thread Simon Brooke
On Dec 11, 6:39 pm, TNeste wrote: > On Dec 10, 2:15 pm, Simon Brooke wrote: > > > I note people seem mainly to be using Emacs as an editing/development > > environment for Clojure. But as people keep pointing out, Clojure is > > homoiconic; the canonical source of a

In core structure editor, anyone?

2008-12-10 Thread Simon Brooke
I note people seem mainly to be using Emacs as an editing/development environment for Clojure. But as people keep pointing out, Clojure is homoiconic; the canonical source of a function is not a stream of bytes read from a file, but is a structure in core. Now, in-core editing does raise some iss

Macros and namespaces

2008-11-20 Thread Simon Brooke
I sense already that I'm going to annoy people with this post, but hear me out - I do have something significant to say. I've been trying as a learning exercise to implement a subset of Portable Standard Lisp in Clojure, enough to get some non-trivial programs to run. I'm not talking about REDUCE

Re: Macros and syntax-quote

2008-11-20 Thread Simon Brooke
On Nov 20, 12:19 pm, Jarkko Oranen <[EMAIL PROTECTED]> wrote: > On Nov 20, 12:29 pm, Rock <[EMAIL PROTECTED]> wrote: > > > Is there any chance of getting a more thourough explanation within > > Clojure? I'm convinced this is an important issue, especially for > > those coming from the likes of Jav

Namespaces and distinctness

2008-11-19 Thread Simon Brooke
Java has a simple and neat convention for achieving global namespace distinctness without the overhead of a central registry - you just reverse your domain name and append a bit. Is there a similar convention for Clojure namespaces? --~--~-~--~~~---~--~~ You receive

Alioth binary-tree benchmark

2008-11-18 Thread Simon Brooke
a built-in function in Clojure, I did not find it; consequently I implemented an arithmetic-shift function of my own. As I'm as yet unfamiliar with Clojure it's likely that my implementation is less than optimal. ;;; -*- mode: clojure -*- ;;; ;;; http://shootout.alioth.debian.org/ ;;; ;;;

Re: Clojure for LISP programmers....

2008-11-17 Thread Simon Brooke
On Nov 17, 3:52 am, Luc Prefontaine <[EMAIL PROTECTED]> wrote: > Since it's existence, LISP has not gained a large acceptance in the > commercial market compared to other "conventional" programming > languages. This is true; I think, though, it's largely a fashion thing. In the days when you and

Re: Clojure for LISP programmers....

2008-11-17 Thread Simon Brooke
On Nov 17, 7:43 am, "Howard Lewis Ship" <[EMAIL PROTECTED]> wrote: > I generally like that Clojure dispenses with parens that exist for the > benefit of the evaluator rather than the developer; thus far fewer > parens when using (cond).  Still, my old Lisp habits (20 years without > use) succumbed

Re: Clojure for LISP programmers....

2008-11-17 Thread Simon Brooke
On Nov 16, 11:01 pm, Brian W <[EMAIL PROTECTED]> wrote: > I'm going to assume this is serious and not a joke, but you do realize > Clojure is already quite well documented at clojure.org? I admit I started without reading the documentation, but having got stuck I then read the documentation - bot

Clojure for LISP programmers....

2008-11-16 Thread Simon Brooke
Has anyone written a very simple introduction to Clojure for LISP hackers? I've spend an evening playing with it pretty intensively, and thus far I haven't got a thing to work. I've read http://en.wikibooks.org/wiki/Clojure_Programming#Clojure_for_Common_Lisp_Programmers, but it hasn't helped me.