unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: tomas@fabula.de
Cc: guile-user@gnu.org
Subject: Re: [Fwd: Req for help on objects and environments]
Date: Thu, 2 Sep 2004 13:53:16 +0200	[thread overview]
Message-ID: <20040902115316.GB30187@www> (raw)
In-Reply-To: <1094123345.4412.5.camel@kuzgun>


[-- Attachment #1.1: Type: text/plain, Size: 1552 bytes --]

On Thu, Sep 02, 2004 at 02:09:05PM +0300, Alp ?ztarhan wrote:
> Maybe I should give more information:
> 
> 1) I work on gentoo linux guile 1.6.4
> 
> 2) I try to program in Scheme. I DO NOT use C or C++ in my project.
>    Just pure Scheme.
> 
> 3) I try to control the environment I "eval" my expression, but
>    manipulating the environment is not described in my documentation.
>    (which comes with guile-1.6.4)

AFAIK eval takes an expression and a module (which is an environment)
to eval the expression in. I don't quite understand your problem.
Could you give some examples?

> 4) I also want to use the (make-object-property) scheme procedure.
>    Unfortunately, I cannot list the properties of a given object.

Like this?

 | guile> (define x 42)
 | guile> (set-object-property! x 'colour 'green)
 | green
 | guile> (set-object-property! x 'size 42)
 | 42
 | guile> (set-object-property! x 'friends '(alfred bert carol))
 | (alfred bert carol)
 | guile> (object-properties x)
 | ((friends alfred bert carol) (size . 42) (colour . green))
 | guile> (object-property x 'friends)
 | (alfred bert carol)

(note that the object properties is an alist, the key being the car of the
sublists, the value the cdr. But you can (and usually should) ignore that
and use object-property, object-properties and so on).

(Note as well that the properties get attached to the *value*, not to the
*variable*):

 | guile> (object-property 42 'friends)
 | (alfred bert carol)

Does this help?

Regards
-- tomás

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user

  reply	other threads:[~2004-09-02 11:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-02 11:09 [Fwd: Req for help on objects and environments] Alp Öztarhan
2004-09-02 11:53 ` tomas [this message]
2004-09-02 12:47   ` Alp Öztarhan
2004-09-02 19:19     ` Stephen Compall
2004-09-03 19:10   ` Req for help on objects and environments Andy Wingo
2004-09-06 22:34     ` macro documentation? (was: Re: Req for help on objects and environments) Richard Todd
2004-09-07 18:40       ` Andy Wingo
2004-09-03 20:27 ` [Fwd: Req for help on objects and environments] Ludovic Courtès
2004-09-04 11:31   ` Marius Vollmer
2004-09-04 13:07     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040902115316.GB30187@www \
    --to=tomas@fabula.de \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).