unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Eli Barzilay <eli@barzilay.org>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel@gnu.org
Subject: Re: *current-language*
Date: Fri, 6 Jan 2012 21:30:05 -0500	[thread overview]
Message-ID: <20231.44589.663929.663333@winooski.ccs.neu.edu> (raw)
In-Reply-To: <87y5tkgt6g.fsf@pobox.com>

20 minutes ago, Andy Wingo wrote:
> Guile's REPL does do that, yes.  I think that Noah's proposal was to pun
> the ,language command so that in a file, instead of 
> 
>    #!lang r5rs
>    (eval '(+ 1 2) (scheme-report-environment 5))
> 
> you could have
> 
>    ,language r5rs
>    (eval '(+ 1 2) (scheme-report-environment 5))
> 
> Cute.  I guess it would work if we changed the reader, for the same
> reason that it works at the REPL.

Ah, in that case, the obvious thing to note is that the part of our
reader that deals with reading the language is not using the sexpr
reader.  For example:

  #lang |racket|

doesn't work.

The only small hack is that the default reader is the one that's used
to read the file, and it changes when it runs into a `#lang'.  Because
of this things like

  ;; some comment
  #lang racket
  ...

still work.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!



  reply	other threads:[~2012-01-07  2:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201201070033.q070X8vT001386@winooski.ccs.neu.edu>
2012-01-07  1:56 ` *current-language* Eli Barzilay
2012-01-07  2:09   ` *current-language* Andy Wingo
2012-01-07  2:30     ` Eli Barzilay [this message]
2012-01-07 22:41     ` *current-language* Ludovic Courtès
2011-06-12  1:24 *current-language* BT Templeton
2011-07-09  1:03 ` *current-language* BT Templeton
2011-12-04 21:01 ` *current-language* Andy Wingo
2011-12-06  0:36   ` *current-language* Noah Lavine
2012-01-07  0:19     ` *current-language* 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=20231.44589.663929.663333@winooski.ccs.neu.edu \
    --to=eli@barzilay.org \
    --cc=guile-devel@gnu.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).