unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Jon Wilson <j85wilson@fastmail.fm>
Cc: Guile Users <guile-user@gnu.org>
Subject: Re: How could this be implemented?
Date: Sun, 14 Jan 2007 19:37:30 -0600	[thread overview]
Message-ID: <45AADADA.6080603@fastmail.fm> (raw)
In-Reply-To: <45AAC50F.5090304@bothner.com>

Hi Per,

Per Bothner wrote:
> You really have to treat ls as a macro, which is resolved at
> compile-time.  Otherwise, it becomes near-impossible to
> compile name-lookup efficiently.  And if you can't compile
> it, it's a toy.
Bash script is not compiled, but it is quite useful.  Not a toy at all.

> > ... and it is bound to some value that we can see ...
>
> This is the hard part: what does "that we can see" mean?
Perhaps I'm missing something, because this does not seem at all 
difficult.  Suppose I am running some guile code.  I type something like:

guile>(+ 2 5)

Eval looks up the + symbol and sees that it is bound to a primitive 
function.  So, what "that we can see" means is anything which eval is 
already and normally able to resolve to some value.  Perhaps the best 
way to implement this would be as an error handler for the Unbound 
variable error.

guile>(ls)

Backtrace:
In current input:
   2: 0* (ls)

<unnamed port>:2:1: In expression (ls):
<unnamed port>:2:1: Unbound variable: ls
ABORT: (unbound-variable)


Instead of dying when a variable in the function spot is not bound, we 
would do a quick $PATH lookup, and if we found something then, we'd 
execute it.  Otherwise, we'd just go ahead with the Unbound variable 
error as normal.
Regards,
Jon


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


  reply	other threads:[~2007-01-15  1:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-14 22:50 How could this be implemented? Jon Wilson
2007-01-15  0:04 ` Per Bothner
2007-01-15  1:37   ` Jon Wilson [this message]
2007-01-15  2:44     ` Jon Wilson
2007-01-15  2:50     ` Per Bothner
2007-01-15  3:34       ` Jon Wilson
     [not found]     ` <932b2f1f0701141859q4633322raf9b6370f7480396@mail.gmail.com>
2007-01-15  3:08       ` Jon Wilson
2007-01-15 19:31         ` Alan Bram
2007-01-15 10:13 ` Andy Wingo
2007-01-16 21:37   ` Jon Wilson
2007-01-17  8:30     ` 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=45AADADA.6080603@fastmail.fm \
    --to=j85wilson@fastmail.fm \
    --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).