unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: rm@fabula.de
Cc: guile-devel@gnu.org
Subject: Re: illegal uses of define in guile
Date: Tue, 15 Oct 2002 14:45:20 +0200	[thread overview]
Message-ID: <20021015124520.GA513@www> (raw)
In-Reply-To: <Pine.GSO.4.05.10210141858170.28259-100000@sallust.ida.ing.tu-bs.de>

On Mon, Oct 14, 2002 at 07:17:03PM +0200, Dirk Herrmann wrote:
> Hi,
> 
> (I have been quiet for some time because I was on vacation.)
> 
> with respect to defines and top level forms, I would like to point out the
> following issue (which may also be of relevance for the ideas you discuss
> in the file new-model.txt, Marius).
> 
> Currently, guile allows the following:
>   (if (not (defined? '%load-verbosely))
>       (define %load-verbosely #f))
> as can be found in r4rs.scm.
> 
> This is in contrast to R5RS (maybe even already in contrast to R4RS,
> but I haven't checked that).  Allowing such placements of define will make
> it impossible to determine statically whether after evaluation of the
> form the corresponding identifier will be bound or not.  That is, we
> should disallow this behaviour.

Hmm, doesn't the above imply that the side-effect' of 'define' is static?
What about code like the following:

  (use-module (ice-9 safe))

  (define my-context (current-module))

  (if some-weird-condition
      (set! my-context (make-safe-module)))

  ;; the side-effect of define here will depend on
  ;; the boolean interpretation of 'some-weird-condition'

  (eval (define car #f) my-context)

  ;; or, even meaner ...
  (define (nodefine sym val)
    (display "Safe environ: no (re)definition allowed!\n"))

  (eval (define  define nodefine) my-context)

Maybe a bit constructed but i can well imagine similar usefull situations.

 Ralf Mattes


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


  parent reply	other threads:[~2002-10-15 12:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-14 17:17 illegal uses of define in guile Dirk Herrmann
2002-10-14 17:49 ` Bruce Korb
2002-10-14 19:42   ` Neil Jerram
2002-10-15  0:18     ` Bruce Korb
2002-10-15  6:15       ` Dirk Herrmann
2002-10-15 10:49         ` tomas
2002-10-15 13:33         ` rm
2002-10-15 13:58         ` Bruce Korb
2002-10-15 12:45 ` rm [this message]
2002-10-18 21:55 ` Marius Vollmer
  -- strict thread matches above, loose matches on Subject: below --
2002-10-19 15:22 Dirk Herrmann
2002-10-19 15:44 ` Marius Vollmer
2002-10-21 10:04 ` tomas
2002-11-03 16:28   ` Marius Vollmer
2002-11-04 10:21     ` tomas

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=20021015124520.GA513@www \
    --to=rm@fabula.de \
    --cc=guile-devel@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).