Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Array representation in scheme

Tags:

scheme

I am a newbie to the realm of functional programming and have just started learning Scheme (though it is a semi-functional programming language). I did some tutorials on lists which is well supported in Scheme. I was wondering whether Scheme has support for fiddling with arrays ?

Or do I need to define my own data type ? Lists are an inductively defined data types. If I'm to define arrays as a new data type then can it be defined inductively ?

Please help. Thanks in advance.

cheers

like image 802
Arnkrishn Avatar asked Feb 21 '09 17:02

Arnkrishn


1 Answers

You're looking for vector.

(define arr (vector 1 2 3))
(define arr '#(1 2 3))
like image 128
CTT Avatar answered Sep 24 '22 12:09

CTT