guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

substitution in a list


From: orianaparo
Subject: substitution in a list
Date: Tue, 23 Jan 2007 12:20:34 +0100

Hi. I'm a newbie and I'm trying to write some programs in Guile.
I'd like to know how I can perform a substitution in a list.
I mean:I want to write a function that takes two arguments: a list (possibly 
nested) of symbols [e.g ((a (b c) d) a (f b))] and another list that indicate 
what sort of substitution the function should perform [e.g. ((a z) (b y))]. 
This means that the symbol "a" has to be substituted by the symbol "z" and the 
symbol "b" by "y".

This example shows you what I need to do:

The following should return TRUE:

(equal?
(substitute
'((a (b c) d) a (f b))
'((a z) (b y))
)
'((z (y c) d) z (f y))
)



------------------------------------------------------
Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
http://click.libero.it/infostrada23gen07






reply via email to

[Prev in Thread] Current Thread [Next in Thread]