Small Problem: Which Strings Differ at One Location

2011-05-30 Thread joshua-choi
Let's say that I have a set of strings, each three English letters long. How can I determine which strings differ only at one location (e.g. xxe and xbe)? Right now, I'm writing a loop that sequentially compares every string to every other string. I think that there's a better way, but I don't

Re: Small Problem: Which Strings Differ at One Location

2011-05-30 Thread joshua-choi
/828413 2011/5/30 joshua-choi rbysam...@gmail.com: Let's say that I have a set of strings, each three English letters long. How can I determine which strings differ only at one location (e.g. xxe and xbe)? Right now, I'm writing a loop that sequentially compares every string

JavaFX alternative languages talk at JavaOne

2010-09-12 Thread joshua-choi
I have no idea how many of you both care at all about JavaFX and are planning to go to the JavaOne conference tomorrow Monday in San Francisco, but there's apparently going to be a talk about using the JavaFX platform from alternative languages, particularly Clojure, at 4 PM. I myself can't go,

Re: Macro problems with delay

2010-09-10 Thread joshua-choi
that function call in the macro does prevent the error. I don't understand it. Konrad Hinsen wrote: On 10 Sep 2010, at 03:11, joshua-choi wrote: And here is a full macro-expansion of the call at which the error happens: http://gist.github.com/572879 If I understand the comment

Re: Macro problems with delay

2010-09-10 Thread joshua-choi
of a delay into macro code is somewhere else, but I don't know. Meikel Brandmeyer wrote: Hi, On 10 Sep., 03:11, joshua-choi rbysam...@gmail.com wrote: I am running into a problem sometimes when I call a certain macro I defined. This problem macro (and an associated problem function

Re: Macro problems with delay

2010-09-10 Thread joshua-choi
call, resulting in the error. The solution was to change (alter-var-root maker-var# named-rule-maker ~rule-type-kw) to (when (= '~def-form `defmacro) (alter-var-root maker-var# named-rule-maker ~rule-type-kw)) Thanks, everyone for your help. joshua-choi wrote: That ought

Macro problems with delay

2010-09-09 Thread joshua-choi
I am running into a problem sometimes when I call a certain macro I defined. This problem macro (and an associated problem function) is: http://gist.github.com/572875 I run into this error (which is at a call to the macro, but *not* at the *first* time it's called for some reason!):

Re: Another JavaFX and Clojure Demo

2010-08-23 Thread joshua-choi
This is fascinating—I too am interested in Clojure-JavaFX interaction. Thanks a lot for putting this up! On Aug 21, 8:43 pm, Sam Griffith stayp...@mac.com wrote: Hello group, I'd replied a long time ago to one of the posts about JavaFX and Clojure working together... I've now finally gotten

Re: DSL with a grammar

2010-07-08 Thread joshua-choi
Consider using FnParse (http://github.com/joshua-choi/fnparse/tree/ develop). It's a pure Clojure parser combiner that is flexible in what tokens it accepts. You can use it to parse the symbol/list/etc. structures given to your macros into other forms. FnParse 3, the latest version, is currently

Language request: Passing metadata to a fn from its name (in a fn form)

2010-05-24 Thread joshua-choi
I have a language request for the fn special form. Functions can now have metadata. This is great, and very useful for me. I'd like to request that now the (fn name …) form pass on any metadata on the name symbol to the function itself: user= (meta (fn ^{:a 3} name …)) {:a 3} This would

Re: Language request: Passing metadata to a fn from its name (in a fn form)

2010-05-24 Thread joshua-choi
be proxying AFn instead? On May 24, 3:24 pm, joshua-choi rbysam...@gmail.com wrote: I have a language request for the fn special form. Functions can now have metadata. This is great, and very useful for me. I'd like to request that now the (fn name …) form pass on any metadata

Re: Splitting a string with the characters between each split?

2010-05-14 Thread joshua-choi
 de) ;; (ab c   de) Justin On May 13, 12:24 pm, joshua-choi rbysam...@gmail.com wrote: I'd like to know if there's a standard function similar to clojure.contrib.string/split that includes the characters between the spitted string, or if there isn't one, how I might write one. In other

Splitting a string with the characters between each split?

2010-05-13 Thread joshua-choi
I'd like to know if there's a standard function similar to clojure.contrib.string/split that includes the characters between the spitted string, or if there isn't one, how I might write one. In other words, I'd like a function split* such that (split* #\s+ ab c de) returns (ab cde). --

Re: Splitting a string with the characters between each split?

2010-05-13 Thread joshua-choi
the word boundary regexp operator. (ns foo.bar   (:use [clojure.contrib.string :only [split]])) (defn split* [s]   (drop 1 (split #\b s))) (split* ab c  de) ;; (ab c   de) -Drew On Thu, May 13, 2010 at 11:24, joshua-choi rbysam...@gmail.com wrote: I'd like to know if there's a standard

Re: removing the need for refer-clojure ?

2010-05-05 Thread joshua-choi
I would love if this happened; it could probably be implemented in a backwardly compatible way, since you're currently not supposed to use or require clojure.core anyway, as far as I know. On May 5, 8:36 am, Laurent PETIT laurent.pe...@gmail.com wrote: Hello, After thinking twice about it, ns

Re: Trouble with Leiningen and Autodoc

2010-05-03 Thread joshua-choi
Yes, http://github.com/joshua-choi/fnparse/tree/develop. You must use the latest tree in the develop branch (which is at the time of this writing commit baf3b39f51fdd3893471f52d330336b5a794fa6d). Thanks for the help, and I look forward to what you figure out. On May 3, 12:12 pm, Tom Faulhaber

Re: Trouble with Leiningen and Autodoc

2010-05-03 Thread joshua-choi
Actually, disregard the message above! You don't want the latest tree on the develop branch; it currently throws errors because defalias doesn't work with macros anymore. You want to use the tree at the tag 3.α.3! My apologies. On May 3, 5:15 pm, joshua-choi rbysam...@gmail.com wrote: Yes,http

Calling for advice on a parser's location data

2010-05-02 Thread joshua-choi
I'm making a parsing library that can keep track of its location in a stream of tokens, and the tokens can be of any type—character, map, and so forth. I need advice on this question: Can you think of an instance where the location would not be a line number and column number, such as {:line 3,

Trouble with Leiningen and Autodoc

2010-05-01 Thread joshua-choi
This is my project.clj: (defproject fnparse 3.α.3 :description A library for creating functional parsers in Clojure. :dependencies [[org.clojure/clojure 1.2.0-master-SNAPSHOT] [org.clojure/clojure-contrib 1.2.0-master- SNAPSHOT]] :dev-dependencies [[autodoc 0.7.0]]) I run

Naming factory functions

2010-04-22 Thread joshua-choi
When it comes to naming factory functions—functions that create things— clojure.core gives four precedents: 1. Name it exactly what the new object is called. vector, hash-map, set. 2. Name it a shortened version of #1. vec. 3. Prefix #1 with make-. make-hierarchy, make-array. 4. Prefix #1 with

Are there any plans for more allowed symbol characters?

2010-03-01 Thread joshua-choi
According to http://clojure.org/reader, “Symbols begin with a non- numeric character and can contain alphanumeric characters and *, +, !, -, _, and ? (other characters will be allowed eventually, but not all macro characters have been determined).” Are there any plans of allowing any more symbol

Re: bug: clojure.contrib.json should not default to use keywords.

2010-02-28 Thread joshua-choi
As a small note, according to http://clojure.org/reader, Clojure keywords and symbols are allowed to contain only alphanumeric characters, *, +, !, -, _, and ?. Spaces aren’t allowed, but the keyword function allows them anyway because it doesn’t do any checking for validity for performance. I’m

Re: Prefixed or suffixed symbols?

2010-02-25 Thread joshua-choi
25, 3:16 pm, Jarkko Oranen chous...@gmail.com wrote: On Feb 25, 12:17 am, joshua-choi rbysam...@gmail.com wrote: When it comes to distinguishing certain types of symbols from other things, should one use prefixes or suffixes? Whichever makes more sense, of course. :) Example: naming

Re: Prefixed or suffixed symbols?

2010-02-25 Thread joshua-choi
/master/s... Hope this helps, Sean On Feb 25, 8:59 pm, joshua-choi rbysam...@gmail.com wrote: Yeah, I don’t really like the underscores either. But I have to work with the set of currently allowed non-alphanumeric symbol characters (*, +, !, -, _, and ?, according to clojure.org/reader

Re: Prefixed or suffixed symbols?

2010-02-25 Thread joshua-choi
the behavior version, I think that a special macro is in order (e.g. deftest) Sean On Feb 25, 10:22 pm, joshua-choi rbysam...@gmail.com wrote: Could you explain more what you mean? For instance, how are macros related to these questions? This just has to do with informal naming conventions

Prefixed or suffixed symbols?

2010-02-24 Thread joshua-choi
When it comes to distinguishing certain types of symbols from other things, should one use prefixes or suffixes? Example: naming tests with clojure.test/deftest. If you distinguish your tests’ symbols at all, do you do “t-addition” or “addition-t”? (I need to know what the standard is, if there

Re: idiomatic question about reader macro

2010-02-03 Thread joshua-choi
I see why you want to create your own reader macros—you want to set apart certain code visually. But ataggart has a good point when he keeps asking you for specific examples of your code. Do you want to use reader macros to change something like this: (make-data red blue green) into something

Clojure IRC help

2010-01-24 Thread joshua-choi
Sorry for asking this here, but it's about the Clojure IRC room, which is kind of related to Clojure, being this group's sister help resource. I know nothing about IRC, but I've been using the Colloquy application for Mac OS X to connect to the Clojure IRC room on irc.freenode.net. It was working

Re: Clojure IRC help

2010-01-24 Thread joshua-choi
Thanks for the link; it's helpful. I've registered with Freenode as joshua-choi with a password and nickname, and my IRC client informs me when I reconnect that the server has identified me as joshua-choi. However, when I try to send a message, I still get the same error. Could anything else

Re: Clojure IRC help

2010-01-24 Thread joshua-choi
Ah! Never mind! I just got an email telling me that I had to verify the account! I did that, and I can now send messages to the room (I think). Thanks a lot! On Jan 24, 12:00 pm, joshua-choi rbysam...@gmail.com wrote: Thanks for the link; it's helpful. I've registered with Freenode as joshua

Re: Was it decided to add these functions to core?

2009-06-23 Thread joshua-choi
On creating an infinite range, I think it'd be wonderful if Double/ POSITIVE_INFINITY or something like it would be bound to a core symbol, such as infinity or something. That'd way, one would be able to do things like (range 3 infinity) or ( infinity 5). CuppoJava, how long ago did those

Re: Small question: Best way to create a map with vector vals

2009-06-23 Thread joshua-choi
Come to think of it, this would also work for me: keeping the vector of pairs, and instead using filter to get the values of a key: (defn get-from-pairs [pairs key-to-fetch] (map #(get % 1) (filter #(= key-to-fetch (get % 0)) pairs))) (I wish the key and val functions were defined on vectors

Re: breaking early from a tight loop

2009-06-12 Thread joshua-choi
Is the function of the filter identity call to make (map isInteresting pixels) a lazy sequence? I thought that the sequences map returned were already lazy, but I could be mistaken. On Jun 12, 8:56 am, CuppoJava patrickli_2...@hotmail.com wrote: Hi Vlad, I would approach it like this, and make

Re: breaking early from a tight loop

2009-06-12 Thread joshua-choi
Oh! I see. Thanks for the explanation. On Jun 12, 9:56 am, J. McConnell jdo...@gmail.com wrote: On Fri, Jun 12, 2009 at 12:35 PM, joshua-choi rbysam...@gmail.com wrote: Is the function of the filter identity call to make (map isInteresting pixels) a lazy sequence? I thought

Re: In let: unpacking maps with accessors too

2009-06-08 Thread joshua-choi
Oh, I didn't know that. It makes me wonder, then, why integers were not implemented as functions of sequential collections: (3 [:a :b :c]). Ah, well. I guess since let can't be changed, it's then a choice between using accessors or being more elegant. Thanks for the reply. On Jun 8, 9:25 am,

Re: error-kit + test-is

2009-05-18 Thread joshua-choi
I'd love for that to happen—either error-kit support in test-is or test-is support in error-kit. clojure.contrib libraries should be able to use each other with no worries, since they'll be installed together just about always. On May 17, 12:52 am, Dan Larkin d...@danlarkin.org wrote: Sorry for