Monday, June 21, 2004

I have been looking at a bit of scheme in my free time. Not strangely, most of the code I seem to write seems to be very C like.

 

(define rev1 (lambda (ls)

        (let loop ((res ()) (ls ls))

                (if (null? ls) res

                        (begin

                                (set! res (cons (car ls) res))

                                (loop res (cdr ls)))))))

 

(define rev2 (lambda (ls)

        (let loop ((left ls)(right ())(temp ()))

                (cond ((null? left) right)

                        (else

                                (set! temp (cdr left))

                                (set-cdr! left right)

                                (loop temp left ()))))))

       

 

(print (rev2 '(1 2 3 4 5)))

 

I understand that learning the language is very different from learning to program with it. For now I am learning the language from Dorai Sitaram’s “Teach Yourself Scheme in Fixnum Days”

 

Annie’s song is playing right now.

The sky looks gray now, like the color of old memory.

 

Annie's Song

 

You fill up my senses

Like a night in a forest

Like the mountains in springtime

Like a walk in the rain

Like a storm in the desert

Like a sleepy blue ocean

You fill up my senses

Come fill me again

 

Come let me love you

Let me give my life to you

Let me drown in your laughter

Let me die in your arms

Let me lay down beside you

Let me always be with you

Come let me love you

Come love me again

 

You fill up my senses

Like a night in a forest

Like the mountains in springtime

Like a walk in the rain

Like a storm in the desert

Like a sleepy blue ocean

You fill up my senses

Come fill me again

 

John Denver

 

 

Monday, June 21, 2004 6:59:15 AM (Eastern Standard Time, UTC-05:00)
I love that song too. Did you know he actually sang it after Annie left him and then she came back after hearing this song?

Also, there is Annie's Other Song - another fav - have pasted the lyrics below:

I'm bringin' me home to you
It's all that i have to give
My life, my love, my everything
It's you i choose to be with

Had a wonderful time in the city
I smile when i recall
The space, the songs, the company
I really had a ball

It's a funny set of circumstances
Is me out on the road alone
With the moon lookin' over my shoulder
I'm findin' my way back home

I'm bringin' me home to you
It's all that i have to give
My life, my love, my everything
It's you i choose to be with

Ridin' high in the rocky mountains
It's a quiet and peaceful time
I'd swear the stars are smilin'
Like they know what's on my mind

You see on any such an occasion
My thoughts will turn to you
The time i spend all by myself
I mostly spend with you

La la la.......

I'm bringin' me home to you
It's all that i have to give
My life, my love, my everything
It's you i choose to be with

When i laid down beside you
And all the love that you showed
I want to live my life with you
It's all the dreams that i know

Bringin' me home to you
It's all that i have to give
My life, my love, my everything
It's you i choose to be with
It's you i choose to be with
It's you i want to live with

La la la.......

Monday, June 21, 2004 12:30:04 PM (Eastern Standard Time, UTC-05:00)
I hadnt even heard of that one. It seems to beautiful, I can imagine Denver sing it. I wish I could get to hear this piece.

On a positive note, I heard from the folk developing dasBlog that they are working on adding a archive feature. That should atleast let me find my own previous entries :)
Roshan
Tuesday, June 22, 2004 12:01:26 AM (Eastern Standard Time, UTC-05:00)
(define rev3 (lambda (ls)
(letrec
((rev
(lambda (l r)
(if (eq? l '())
r
(rev (cdr l) (cons (car l) r))))))
(rev ls '()))))
Sidharth
Tuesday, June 22, 2004 12:54:38 AM (Eastern Standard Time, UTC-05:00)
Hey neat.. that looks cleaner than mine - more similar to the first one right?
I think I am begining to think like a schemer:

(define lengthof (lambda (ls)
(apply + (map (lambda (x) 1) ls))))

(lenghtof '(1 2 3 4 5 6)) ==> 6

Roshan
Wednesday, June 23, 2004 2:43:25 AM (Eastern Standard Time, UTC-05:00)
What about a Unix shell built on top of scheme?

http://www.scsh.net/

#!/usr/local/bin/scsh -s
!#
(for-each (lambda (arg) (display arg) (display " "))
command-line-args)

Rings a bell?

Some people had been trying to build Emacs with Guile as the extension language. The project appears to be dead and smelly though :)

http://gemacs.sourceforge.net/
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview