[CM] 2 questions

Orm Finnendahl finnendahl@folkwang-hochschule.de
Thu, 17 Oct 2002 18:00:43 +0200


Hi all,

Two questions concerning cm with guile:

1. when specifying a new pattern I figure it is required to specify
   the type of pattern elements. How is it possible to store arbitrary
   symbols in a cycle pattern in order to get the following:
   
   (next (new cycle my-items <?> '(*a* *b* 'foo 'bang *c*)) #t)

   -> (*a* *b* 'foo 'bang *c*)


2. How can I access the symbol-value of a symbol?

   I'm looking for some equivalent of the following:

   (progn
    (defvar *a* 3)
    (defvar *b* 23)
    (defvar *my-seq* '(*a* *b*))

    (loop for x in *my-seq*
      collect (symbol-value x))
   )

   -> (3 23)


   In scheme it should say something like this:

   (begin
    (define *a* 3)
    (define *b* 23)
    (define my-seq '(*a* *b*))
    (loop for x in my-seq
      collect (symbol-value x))
   )

   But this doesn't work, as symbol-value doesn't exist there.

I know, the 2nd question isn't really directly related to cm, but I
thought I'd ask here anyway...

Yours,
Orm