home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!snorkelwacker.mit.edu!ai-lab!zurich.ai.mit.edu!jinx
- From: jinx@zurich.ai.mit.edu (Guillermo J. Rozas)
- Newsgroups: comp.lang.scheme
- Subject: Re: wots going on here!?
- Message-ID: <JINX.92Aug31170432@chamarti.ai.mit.edu>
- Date: 31 Aug 92 21:04:32 GMT
- References: <1187.9208311520@subnode.aiai.ed.ac.uk> <17timvINN7b8@agate.berkeley.edu>
- <17tn1uINNkij@early-bird.think.com>
- Sender: news@ai.mit.edu
- Reply-To: jinx@zurich.ai.mit.edu
- Organization: M.I.T. Artificial Intelligence Lab.
- Lines: 66
- In-reply-to: barmar@think.com's message of 31 Aug 92 18:05:50 GMT
-
- In article <17tn1uINNkij@early-bird.think.com> barmar@think.com (Barry Margolin) writes:
-
- | Application of inapplicable object #[undefined-value]
- |
- | There is no environment available;
- | using the current REPL environment
- | ;Package: (user)
- |
- | The user has to infer that #[undefined-value] is the default value of a
- | variable, and that "Application of inapplicable object" means that he tried
- | to use it as a function. And even once he figures out what that means, it
- | doesn't tell him where the undefined function came from. Then there's the
- | stuff about the environment, package, and the "REPL". The following (from
- | Lucid CL) is somewhat more reasonable (although it would probably have to
- | be augmented to include Scheme-specific information):
- |
- | >>Error: The function FOOBAR is undefined
- |
- | SYMBOL-FUNCTION:
- | Required arg 0 (S): FOOBAR
- | :C 0: Try evaluating #'FOOBAR again
- | :A 1: Abort to Lisp Top Level
- |
-
- I won't disagree that the error message is obtuse at best, however you
- did not understand the error message even after my explanation, so
- please tell me what I (or it) should say, and perhaps we can spend
- another 3 days on each possible error message.
-
- #[undefined value] is not the default value of any variable.
- The user would have gotten the "unbound variable" error instead.
-
- #[undefined value] is what the implementation uses for the value of
- certain unspecified constructs in the language.
-
- In particular, it is the value of a 1-armed IF whose predicate
- evaluated to false. The value of a COND with no ELSE clause none of
- whose predicates matched, etc.
-
- Although I have no idea what the code was, I can construct pieces of
- code that would generate it.
-
- An example is
-
- (define (foo x)
- (if (even? x)
- (lambda (x) (/ x 2))))
-
- (define (bar y)
- ((foo y) y))
-
- and then used as
-
- (bar 23)
-
- There are many other ways to generate this error.
- BTW, the current version (in house) of MIT Scheme prints the
- following:
-
- (bar 23)
- ;The object #[undefined-value] is not applicable.
- ;To continue, call RESTART with an option number:
- ; (RESTART 2) => Specify a procedure to use in its place.
- ; (RESTART 1) => Return to read-eval-print level 1.
-
- Of course, you can also invoke (DEBUG).
-