unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Daniel Kraft <d@domob.eu>
To: Andy Wingo <wingo@pobox.com>
Cc: Ken Raeburn <raeburn@raeburn.org>,
	guile-devel <guile-devel@gnu.org>,
	Neil Jerram <neil@ossau.uklinux.net>
Subject: Re: Elisp lexical-let
Date: Fri, 24 Jul 2009 08:50:10 +0200	[thread overview]
Message-ID: <4A6959A2.8090908@domob.eu> (raw)
In-Reply-To: <m3y6qfgltl.fsf@pobox.com>

Andy Wingo wrote:
>> I'll keep in mind also the lexbind idea of optionally making every
>> binding lexical.  Andy, can you give me a hint/example/pointer how
>> compiler options work?  This would be exactly the place to provide this,
>> I think.  Additionally we could add an option to remove the "variable is
>> void" error check for a further performance gain.
> 
> They don't work! Well, basically they're just a value that reaches the
> compiler somehow. I think they are a keyword list: (#:foo bar #:baz qux)
> etc. They are set via the #:opts argument to compile; I don't know if
> you can set them from the command line. I was waiting for a use case :)

thanks for the hints, I did some tests yesterday, and it seems that I 
can just provide whatever value I want to (compile ... #:opts <options>) 
and get this as opts of the compiler routine called.

I've never used keyword lists before, but I'll look them up and this 
seems like what we want.  So far I'm thinking about two possibly useful 
options:

1) Declare to disable void checks for certain variables or all (for 
performance, as already written).  Stuff like makunbound/boundp will 
sill work just as before, but accessing a variable that is void will not 
give an error but rather return the special void value.  As most code 
should not really depend on this void-error anyways, it seems reasonable 
to give at least a way to disable this check happening on each and every 
variable access for no good (except debugging maybe).

2) Declare that certain variables or all should always be bound 
lexically rather than dynamically; maybe a defvar construct will retract 
this and make it dynamically bound later on again, then this should be 
like the upcoming lexbind stuff in emacs.  As lexical-let is not 
everything, but function arguments are always dynamically bound (except 
if we provide a lexical-lambda... hm, it might even be useful at times!) 
-- and this spoils tail-calls -- both of this option and lexical-let 
will probably be useful.

And maybe others in the future, but I've no ideas so far.  It seems that 
options work basically, but I guess there's not yet a way to "set" them 
for compilation happening for the elisp-repl?  This means that I can 
just keep on implementing and testing them, but for real use we probably 
want some construct to set them for real uses (besides (compile ...)) as 
well.

Cheers,
Daniel

-- 
Done:  Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri




  reply	other threads:[~2009-07-24  6:50 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-21 19:48 Elisp lexical-let Daniel Kraft
2009-07-21 21:46 ` Ken Raeburn
2009-07-22  9:11   ` Daniel Kraft
2009-07-22 13:00     ` Marijn Schouten (hkBst)
2009-07-22 19:24       ` Daniel Kraft
2009-07-23 15:24         ` Marijn Schouten (hkBst)
2009-07-23 16:13           ` Mark H Weaver
2009-07-23 20:53             ` Andy Wingo
2009-07-23 17:05           ` Daniel Kraft
2009-07-24 11:09             ` Marijn Schouten (hkBst)
2009-07-22 20:50     ` Ken Raeburn
2009-07-23 10:47       ` Daniel Kraft
2009-07-23 20:56         ` Andy Wingo
2009-07-24  6:50           ` Daniel Kraft [this message]
2009-07-23 20:49     ` Andy Wingo
2009-07-23 22:39 ` Andy Wingo
2009-07-24  7:08   ` Daniel Kraft
2009-07-24 11:42     ` Andy Wingo

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=4A6959A2.8090908@domob.eu \
    --to=d@domob.eu \
    --cc=guile-devel@gnu.org \
    --cc=neil@ossau.uklinux.net \
    --cc=raeburn@raeburn.org \
    --cc=wingo@pobox.com \
    /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).