:strs and :syms directives

2010-02-17 Thread metaperl
Hi, the ref manual  introduces :keys
which I understand. It then says:

"""There are similar :strs and :syms directives for matching string
and symbol keys."""

but no example is given. Could someone supply an example for each of
these directives please? I simply am finding the manual too terse
here.

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


since a list of chars is not a string...

2010-02-17 Thread metaperl
The reference manual example implies that a list of chars is not a
string:

(let [[a b & c :as str] "asdjhhfdas"]
  [a b c str])
->[\a \s (\d \j \h \h \f \d \a \s) "asdjhhfdas"]


So what functions exist for conversion from chars to string and vice
versa?

Also how should I have been able to use the API docs  to find the
conversion functions myself?

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


can the :test metadata be used to constrain the range of a variable?

2010-02-17 Thread metaperl
I tried to use :test to constrain the range of a variable, but it
didnt seem to work. Am I misunderstanding the purpose of this keyword?

user=> (def #^{ :doc "Integer between -5 and 5" :test (fn [] (assert
(and (> x -5) (< x 5} x 12)
#'user/x
user=> user/x
12

I had hoped this would throw an exception or something...

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


#

2010-02-17 Thread metaperl
Hello, I'm trying to study this page  using NetBeans Enclojure.

I was able to successfully define and use the mymax function, but when
I try to examine the metadata, I get the error above. Source code and
REPL transcript follow:



user=> (com.new-ns/mymax 4 2 9 1)
9
user=> #^'com.new-ns/mymax
#
user=> #
user=> #
user=>




(ns com.new-ns
  ;(:require )
  ;(:use )
  ;(:import )
  )


(defn
#^{:doc "mymax [xs+] gets the maximum value in xs using > "
   :test (fn []
 (assert (= 42  (mymax 2 42 5 4
   :user/comment "this is the best fn ever!"}
  mymax
  ([x] x)
  ([x y] (if (> x y) x y))
  ([x y & more]
   (reduce mymax (mymax x y) more)))



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


swank-clojure and Cygwin

2010-02-16 Thread metaperl
Hello,

M-x slime

is failing on Emacs 23.1 under Cygwin as follows below.

My suspicion is that Unix paths are not being converted to Windows via
cygpath 
before calling java -jar

===

(require 'swank.swank)

(swank.swank/ignore-protocol-version nil)

(do (.. java.net.InetAddress getLocalHost getHostAddress) nil)
(swank.swank/start-server "/cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/
slime.4420" :encoding "iso-latin-1-unix")

java.lang.NoClassDefFoundError: clojure/main
Caused by: java.lang.ClassNotFoundException: clojure.main
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: clojure.main.  Program will exit.
Exception in thread "main"
Process inferior-lisp exited abnormally with code 1


==

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en