Extract tested stuff from REPL, can i ?

2010-02-27 Thread uap12
Hi!
I have installed ClojureBox with Emacs.
I test to write stuff, direct in the REPL, so is there som easy way of
get the function defined out,
i know i should write them in a src-file first but i would be nice
when just testing to be able to
do the other way to..

// Anders

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


Advice to a beginner on Clojure

2010-03-01 Thread uap12
I trying to learn Clojure, and the best way fore me is to take a
"problem" and solve it in a new language.
But i would like som to point out what to look fore.

The problem is like a Mastermind
1. I have numberserie let say 1 2 3 4 5 6 7 8 9
2. i pick let say 4 number
3. i like to have a list och all 4 digit combinations possible..

Example of digit 4 5 6 3
So my solution would be to tack
4 + and rotate 5 6 3 like
4 5 6 3 -> 4 6 3 5 -> 4 3 5 6 -> 4 6 3 5 then move whole serie one
step
5 6 3 4 ..

I don't what a ready solution but som direction, witch function to
look at etc..

Best regards
Anders

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


Beginners question about Don't know how to create ISeq from: Symbol

2010-04-19 Thread uap12
I try to write my first program, but efter put the
"(take 7 (repeatedly get-number))" in a function i get an error, i
have search on it but can't figure why,
could some on tell my what is wrong, and a explanation (att a basic
level *smile*)

The error
Don't know how to create ISeq from: Symbol

;The code
(ns com.persson.lotto
(:gen-class))


(defn get-number []
  (rand-int 35))

(defn make-lotto []
(take 7 (repeatedly get-number)))

(defn -main
(make-lotto))
([] (-main )))

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


Re: Beginners question about Don't know how to create ISeq from: Symbol

2010-04-20 Thread uap12
Tanks, i was total focus on the (make-lotto),
// Anders

On 20 Apr, 02:53, Michael Gardner  wrote:
> On Apr 19, 2010, at 4:52 PM, uap12 wrote:
>
> > (defn -main
> >    (make-lotto))
> > ([] (-main )))
>
> You're missing the empty arglist in your definition of -main. It should be:
>
> (defn -main []
>   (make-lotto))
>
> --
> 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 
> athttp://groups.google.com/group/clojure?hl=en

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


Make a loop in a loop

2010-07-07 Thread uap12
Hi!
I try to make a printout witch vill have year 1999->2010 and every
week
Eg.
Year=1999 Week=1
Year=1999 Week=2
Year=1999 Week=3
Year=1999 Week=4

Year=2000 Week=1

I have made the program in java, but like to try making it in Clojure,
but so far i have got

(defn print-data [year week]
(println  (str  "Y=" year " W=" week)))


// This would not work and  i can't find how to map (print-data with a
external variabel and a range
// I can set week to a fixed number but not.
// Or is this the wrong way of doing it ??

(defn print-data2 [year]
(map (print-data year *) (range 1 53 1)))


(defn run []
(map print-data2 (range 1999 2010 1) ) )

The program vill call an externa system program, with year and week as
input, but for this test i just
like to write them...

// Anders

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


Beginner question to a error "please"

2010-12-20 Thread uap12
Hi,
I just started a hobby project, it download a webbpage, and extract number 
data witch exits between Start rad:   --and --  
Example
Start rad:01 20 20 52 32 85 89

Everything works fine exept -main witch gives a error i don't understand.
Becurse i try to learn Clojure, i like to now what's wrong a way :)

Here is my code

(ns com.persson.extract
;(:import )
;(:require )
)

(defn remove-endlines [file]
  (filter #(not= % \newline)
(filter #(not= % \return) file)))

(defn get-file-without-endlines[file]
(remove-endlines (slurp file) ))

(defn -main[]
(re-find #"Start rad:<\/SPAN>*.<\/TD>" (get-file-without-endlines 
"E:/testing/data/1999_1.txt" )))

And here is the error
---
com.persson.extract=> (-main)
#

Best regards
Anders

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

Re: Beginner question to a error "please"

2010-12-20 Thread uap12
Tanks very mutch for the help.
/Anders

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