[plt-scheme] List Manipulation

From: Ricardo Massamitsu Nonomura (nonomura at moimeichego.de)
Date: Wed Jan 7 04:51:38 EST 2004

Hi All,

I defined a procedure that will take 2 parameters and return a list
where value is a number and currency is the name of the currency :

(define (neuerGeldbetrag value currency)
  (list (* value 1.0) currency))

Therefore (neuerGeldbetrag 2 'Euro) => (2.0 euro)

Then I want a new procedure with 1 parameter that will give me the value
of the currency:

(define (wertVonBetrag aValue)
    (car (aValue)))

Therefore I was expecting that

 (wertVonBetrag (neuerGeldbetrag 2 'Euro)) => 2.0

I tested the result from neuerGeldbetrag with length, which returns 2,
so the result is a list. Why car cannot take the head of that list, but
instead send me the following error msg:

procedure application: expected procedure, given: (2.0 euro) (no

Is (2.0 euro) not a list that car can handle???


        ________________ _..----====~~~~====--,
=====  (______________I_)'- = ,~~----===*===----~~~~
===== / /__..---=='---./
----- `---'---._________.' Ricardo Massamitsu Nonomura
E-Mail: massamitsu_nonomura at hotmail.com
            nonomura at moimeichego.de 
Homepage: www.moimeichego.de
ICQ: 7234230
PGP: Oxo70F0B5C

Posted on the users mailing list.