Re: Leiningen Clojure REPL in Windows doesn't accept arrow keys.

2014-06-24 Thread Taegyoon Kim
Arrow keys work on the latest version! Yay!
 
nREPL server started on port 58049 on host 127.0.0.1 - 
nrepl://127.0.0.1:58049
REPL-y 0.3.1
Clojure 1.6.0
Docs: (doc function-name-here)
  (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e
user=>
 

2014년 5월 5일 월요일 오전 1시 10분 42초 UTC+9, Colin Jones 님의 말:

> It's due to jline not handling virtual key codes on Windows (which fails 
> in some [all?] non-US locales). This has been fixed on jline master by 
> https://github.com/jline/jline2/pull/134, but there's no jline release 
> available yet.
>
> It'll be in the next REPLy release, even if I need to depend on a version 
> I release to clojars (which I've done before since jline's release process 
> moves slower than mine). And we'll try to get it into the next lein release.
>
>
>
> On Sunday, May 4, 2014 10:36:05 AM UTC-5, Taegyoon Kim wrote:
>>
>> I'm in Windows 7.
>> Not only me: REPL-y bug | https://github.com/trptcolin/reply/issues/121
>>
>> Google search | 
>> https://www.google.com/#q=windows+7+lein+repl+arrow&safe=off
>>
>>
>> 2014년 5월 5일 월요일 오전 12시 26분 49초 UTC+9, George Oliver 님의 말:
>>
>>> Arrow keys (left/right movement and up for history) on my lein repl in 
>>> Windows XP works fine. Sounds like something on your system. 
>>>
>>

-- 
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 drawback of the less-parentheses approach

2014-06-09 Thread Taegyoon Kim
Ah, reader macro! Thanks!
 
Ignore next form (#_)
The form following #_ is completely skipped by the reader. (This is a more 
complete removal than the *comment* 
<http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/comment> 
macro which yields nil).
 
(from *http://clojure.org/reader* <http://clojure.org/reader>)
 
Conclusion: Don't use the *comment* 
<http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/comment> 
macro. It makes runtime overhead.
 

2014년 6월 10일 화요일 오후 12시 22분 50초 UTC+9, guns 님의 말:

> On Mon  9 Jun 2014 at 07:07:42PM -0700, Taegyoon Kim wrote: 
> > And you can't do this: 
> > user=> (let [x 1 (comment y 2)] x) 
>
> Alex Miller (?) once pointed out that the #_ reader macro can be chained 
> like this: 
>
> (let [x 1 #_#_y 2] x) 
>
> Pretty nifty. 
>
> guns 
>

-- 
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 drawback of the less-parentheses approach

2014-06-09 Thread Taegyoon Kim
I once liked the Clojure's less-parentheses approach.
 
Today I found that you can't utilize s-expression comments easily in 
Clojure.
 
e.g.
In
(let [x 1 y 2] x)
When you are about to comment out the "y 2" part, you have to move the 
cursor back and forth to insert new parentheses.
 
And you can't do this:
user=> (let [x 1 (comment y 2)] x)
 
IllegalArgumentException let requires an even number of forms in binding 
vector
in user:1  clojure.core/let (core.clj:4043)
 
(comment) in Clojure is not really comment. It returns nil. 
http://clojuredocs.org/clojure_core/clojure.core/comment
 
vs.
 
You can do this in Racket:
> (let ([x 1] #;[y 2]) x)
1
 
#; is s-expression comment in Racket.
 
Parentheses are there to group logically related things together.
 

-- 
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 Clojure REPL in Windows doesn't accept arrow keys.

2014-05-04 Thread Taegyoon Kim
I'm in Windows 7.
Not only me: REPL-y bug | https://github.com/trptcolin/reply/issues/121

Google search | https://www.google.com/#q=windows+7+lein+repl+arrow&safe=off


2014년 5월 5일 월요일 오전 12시 26분 49초 UTC+9, George Oliver 님의 말:

> Arrow keys (left/right movement and up for history) on my lein repl in 
> Windows XP works fine. Sounds like something on your system. 
>

-- 
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: ClassCastException: Object arguments

2014-05-04 Thread Taegyoon Kim
Wow! Thank you very much, squeegee!

Great success!

user=> (String/format "%s %s" (to-array (list "foo" "bar")))
"foo bar"


2014년 5월 5일 월요일 오전 12시 9분 3초 UTC+9, squeegee 님의 말:

> How do you call a method which accepts Object arguments?
>
> String/format | 
> http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html#format(java.lang.String,
>  
> java.lang.Object...)
>
> user=> (String/format "%s" "foo")
> ClassCastException java.lang.String cannot be cast to [Ljava.lang.Object;  
> user/
> eval668 (NO_SOURCE_FILE:1)
>
>
> String/format takes a variable number of arguments in Java. At the JVM 
> level, that’s represented as an array of Objects.
>
> The JVM level class name for an array of objects is shown in the 
> exception: [Ljava.lang.Object
>
> Here’s an example of calling String/format correctly:
>
>
> https://github.com/clojure/clojure/blob/clojure-1.6.0/src/clj/clojure/core.clj#L5284
>
> (String/format fmt (to-array args)
>
> In the case of String/format itself it may be easier to call 
> clojure.core/format instead, but the same pattern applies elsewhere.
>
> If you need an array whose elements have a type more specific than Object, 
> use clojure.core/into-array.
>
> —Steve
>
>

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


Leiningen Clojure REPL in Windows doesn't accept arrow keys.

2014-05-04 Thread Taegyoon Kim

C:\>lein repl
nREPL server started on port 61472 on host 127.0.0.1
REPL-y 0.3.0
Clojure 1.5.1
Docs: (doc function-name-here)
  (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e
user=> ?


I know they use Emacs key bindings. C-f, C-b, C-n, C-p, etc.

Why does it not allow using arrow keys?

Even Emacs supports arrow keys.

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


ClassCastException: Object arguments

2014-05-04 Thread Taegyoon Kim
How do you call a method which accepts Object arguments?

String/format | 
http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html#format(java.lang.String,
 
java.lang.Object...)

user=> (String/format "%s" "foo")
ClassCastException java.lang.String cannot be cast to [Ljava.lang.Object;  
user/
eval668 (NO_SOURCE_FILE:1)

Type hint doesn't help here.

user=> (String/format "%s" ^Object "foo")
IllegalArgumentException Metadata can only be applied to IMetas  
clojure.lang.Li
spReader$MetaReader.invoke (LispReader.java:754)
RuntimeException Unmatched delimiter: )  clojure.lang.Util.runtimeException 
(Uti
l.java:219)





-- 
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 any GUI based Clojure apps out there?

2013-10-17 Thread Taegyoon Kim
DrClojure https://bitbucket.org/ktg/drclojure
 
It is a very simple Clojure IDE.

2013년 10월 17일 목요일 오후 10시 31분 12초 UTC+9, Jonathon McKitrick 님의 말:

> I'd be interested in seeing some client-side apps with a GUI, if there are 
> any.  'Ants' is a good demo, but I'm looking for something a little 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
--- 
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: Clojure 1.5.0 bug (Java interop: Compiler.load(new StringReader(str));)

2013-03-12 Thread Taegyoon Kim
But then(putting RT.init()),
 
Compiler.load() works, but Console (stderr?) says
 
No need to call RT.init() anymore
 
So I think this problem should be fixed.
 

2013년 3월 13일 수요일 오전 11시 32분 5초 UTC+9, Andy Fingerhut 님의 말:

> Yegor Bugayenko posted in a comment on ticket CLJ-1172 (
> http://dev.clojure.org/jira/browse/CLJ-1172) that calling RT.init() 
> before Compiler.load() solved what looks like a similar problem for him.
>
> Andy
>
> On Tue, Mar 12, 2013 at 6:29 PM, Taegyoon Kim 
> > wrote:
>
>> A new error occurred in Clojure 1.5.0.
>>  
>> (Java interop: Compiler.load(new StringReader(str));)
>>  
>> # Code #
>> import java.io.IOException;
>> import java.io.StringReader;
>> import clojure.lang.Compiler;
>> import clojure.lang.RT;
>> import clojure.lang.Var;
>> public class Main {
>> public static void main(String[] args) throws IOException, 
>> ClassNotFoundException {
>> //clojure.main.main(args);
>> 
>> // Load the Clojure script -- as a side effect this initializes 
>> the runtime.
>> String str = "(ns user) (defn foo [a b]   (str a \" \" b)) (def a 
>> 3)";
>> //RT.loadResourceScript("foo.clj");
>> Compiler.load(new StringReader(str));
>> // Get a reference to the foo function.
>> Var foo = RT.var("user", "foo");
>> Var a = RT.var("user", "a"); // reference to the variable a
>> // Call it!
>> Object result = foo.invoke("Hi", "there");
>> System.out.println(result);
>> 
>> System.out.println(a);
>> System.out.println(a.get());
>> }
>> }
>>  
>> Test code: 
>> *https://bitbucket.org/ktg/clojureembedtest*<https://bitbucket.org/ktg/clojureembedtest>(Eclipse
>>  project)
>>
>> Reference: *http://stackoverflow.com/questions/2181774/calling-
>> clojure-from-java*<http://stackoverflow.com/questions/2181774/calling-clojure-from-java>
>>  
>>  
>> $ java -version
>> java version "1.7.0_15"
>> OpenJDK Runtime Environment (IcedTea7 2.3.7) (7u15-2.3.7-0ubuntu1~12.04.1)
>> OpenJDK Client VM (build 23.7-b01, mixed mode, sharing)
>>  $ java -cp clojure-1.5.0.jar:. Main
>>
>> Exception in thread "main" java.lang.**ExceptionInInitializerError
>> at clojure.lang.Compiler.**(Compiler.java:47)
>> at Main.main(Main.java:16)
>> Caused by: java.lang.NullPointerException
>> at clojure.lang.RT.baseLoader(RT.**java:2043)
>> at clojure.lang.RT.load(RT.java:**417)
>> at clojure.lang.RT.load(RT.java:**411)
>> at clojure.lang.RT.doInit(RT.**java:447)
>> at clojure.lang.RT.(RT.**java:329)
>> ... 2 more
>> $ java -cp clojure-1.4.0.jar:. Main
>>
>> Hi there
>> #'user/a
>> 3
>>  
>>  
>>
>> -- 
>> -- 
>> 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.




Clojure 1.5.0 bug (Java interop: Compiler.load(new StringReader(str));)

2013-03-12 Thread Taegyoon Kim
A new error occurred in Clojure 1.5.0.
 
(Java interop: Compiler.load(new StringReader(str));)
 
# Code #
import java.io.IOException;
import java.io.StringReader;
import clojure.lang.Compiler;
import clojure.lang.RT;
import clojure.lang.Var;
public class Main {
public static void main(String[] args) throws IOException, 
ClassNotFoundException {
//clojure.main.main(args);

// Load the Clojure script -- as a side effect this initializes the 
runtime.
String str = "(ns user) (defn foo [a b]   (str a \" \" b)) (def a 
3)";
//RT.loadResourceScript("foo.clj");
Compiler.load(new StringReader(str));
// Get a reference to the foo function.
Var foo = RT.var("user", "foo");
Var a = RT.var("user", "a"); // reference to the variable a
// Call it!
Object result = foo.invoke("Hi", "there");
System.out.println(result);

System.out.println(a);
System.out.println(a.get());
}
}
 
Test code: 
*https://bitbucket.org/ktg/clojureembedtest*(Eclipse
 project)

Reference: *
http://stackoverflow.com/questions/2181774/calling-clojure-from-java*
 
 
$ java -version
java version "1.7.0_15"
OpenJDK Runtime Environment (IcedTea7 2.3.7) (7u15-2.3.7-0ubuntu1~12.04.1)
OpenJDK Client VM (build 23.7-b01, mixed mode, sharing)
$ java -cp clojure-1.5.0.jar:. Main

Exception in thread "main" java.lang.ExceptionInInitializerError
at clojure.lang.Compiler.(Compiler.java:47)
at Main.main(Main.java:16)
Caused by: java.lang.NullPointerException
at clojure.lang.RT.baseLoader(RT.java:2043)
at clojure.lang.RT.load(RT.java:417)
at clojure.lang.RT.load(RT.java:411)
at clojure.lang.RT.doInit(RT.java:447)
at clojure.lang.RT.(RT.java:329)
... 2 more
$ java -cp clojure-1.4.0.jar:. Main

Hi there
#'user/a
3
 
 

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