[:font {:color "#cc"} (subs cell 0 1)]
> (subs cell 1)])])]))
>
> (defn make-grid [col-size data]
> (partition col-size
> (filter #(not= % "") data)))
>
> (print-table
> (make-grid 3 ["cat" "dog" "" "rab
> Jesse,
> Could I see your own version.
Haha, I was afraid someone would say this.
Here is my embarrassingly bad (but working) version:
(defn build-table []
(def num-cols 3)
(def selected-row 0)
(def selected-col 0)
(def all-strings ["apple" "cat" "dog" "" "frog" "elephant"
"gorilla"])
Alright, I got it working. Thanks for the replies.
--~--~-~--~~~---~--~~
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
To unsubscribe from this group, send e
I'm trying to port some Python code to Clojure. I'm new to functional
programming and I hit a function that is causing my brain to melt.
The python function looks something like this:
def build_table():
num_cols = 3
selected_row = 0
selected_col = 0
strings = ["cat", "dog", "",
I'm trying to re-implement some python stuff in clojure. Here's how
it works: I have a class called ArrowKeySelection. I use this class
as a mixin with various gui classes. The class adds some abstract
logic for handling keys - the arrow keys move a selector around a
matrix and the enter key
I notice the front page of the wiki has had some changes awaiting
review:
http://en.wikibooks.org/wiki/Clojure_Programming
Apparently they've been waiting for almost a month now?
I also noticed this comment on the discussion page:
"The approved revision mechanism is killing this wiki. I'm avoid
Here in the wiki:
http://en.wikibooks.org/wiki/Clojure_Programming/Concepts#Libraries
The examples make use of the clojure/ns command, for example:
(clojure/ns example.ourlib)
I had to get rid of the "clojure/" part to make it work. Is the wiki
wrong? If so, could somebody update it?
--~--~
It would be nice if someone updated the wiki with a new example.
I don't understand how the gen-class stuff is supposed to work.
Why doesn't the following work?
(gen-class
:name MyException
:extends [Exception])
(defn user-exception-test []
(try
(throw (new MyException "msg: user excepti
Regarding the editor part, Scite could be a good option, especially
for beginners.
It's a whole hell of a lot simpler than emacs and vim.
All you really have to do by way of configuration is go to "Options" -
> "Open User Options File" and paste in the following lines:
---
file.patterns.lisp=*