Two questions

How do I write a function 'bit' that converts an integer to binary
representation:

(bit 0) -> 2r0
(bit 1) -> 2r1
(bit 2) -> 2r10
(bit 3) -> 2r11
.
.
.

As well, as function 'bit-concat' with the following behavior:

(bit-concat 2r1 2r00) -> 2r100
(bit-concat 2r0 2r00) -> 2r000
(bit-concat 2r011 2r1100) -> 2r0111100
.
.
.

I looked into formats, but everything defaults to integer
representation.  I need to stay in binary representation.  Its for a
genetic algorithm with grey coding.

Thanks!

Scott

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

Reply via email to