Marko Rauhamaa writes:
> Christopher Allan Webber <[email protected]>:
>
>> In sum though, it has a nice s-expression based syntax:
>>
>> scheme@(guile-user)> (define a-horse
>> '(@ ("name" "buttercup")
>> ("age" 6)
>> ("animal" "horse")
>> ("noise" "neigh!")
>> ("food" ("carrot" "oats"))))
>
> Hm, how about:
>
> (define a-horse
> '((name . "buttercup")
> (age . 6)
> (animal . "horse")
> (noise . "neigh!")
> (food . #("carrot" "oats"))))
>
>
> Marko
Hm... that's not bad, using vectors for arrays. It also fixes the
reason I switched it away from simple cons cell style alists...
I was finding pretty-print of such things unreadable:
scheme@(guile-user)> ,pretty-print '(@ (name . "buttercup")
(age . 6)
(animal . "horse")
(food . ("carrot" "oats"))
(mood-noises . (@ ("frustrated" .
"haurrrfff")
("happy" .
"neiiiigh")
("angry" .
"*SNORT*"))))
$7 =
(@ (name . "buttercup")
(age . 6)
(animal . "horse")
(food "carrot" "oats")
(mood-noises
@
("frustrated" . "haurrrfff")
("happy" . "neiiiigh")
("angry" . "*SNORT*")))
However doing this with vectors as the arrays solves it:
scheme@(guile-user)> ,pretty-print '((name . "buttercup")
(age . 6)
(animal . "horse")
(food . #("carrot" "oats"))
(mood-noises . (("frustrated" .
"haurrrfff")
("happy" . "neiiiigh")
("angry" . "*SNORT*"))))
$5 =
((name . "buttercup")
(age . 6)
(animal . "horse")
(food . #("carrot" "oats"))
(mood-noises
("frustrated" . "haurrrfff")
("happy" . "neiiiigh")
("angry" . "*SNORT*")))
I'd be open to the change... if we're going to do the change, we should
do it now, when I'm pretty much the only user. I wonder what David
Thompson thinks?