Comments on: A script error? Really?
You know how I like to say that the simplest things can be the most difficult? Here's another one to consider.
In R3 (and R2) errors tell you their general category. For example, at the console you type:
** Script error: vista has no value
So, is that message really true? (The "Script error" part,
that is. I think we know about the second part - the cow is being milked to the fullest.)
But, is it really a script error? Where's the script?
In fact, this is an evaluation or runtime error, not really a script
error. Those of us who know REBOL understand what the message means. We
translate it in our heads.
Originally, I picked the term "script error" because it sounded more
friendly. It was just pointing out that you created an error with your
These days I regret that naming decision. Yes, it is a small thing, but
I would prefer an error message more like:
** Runtime error: vista has no value
The message could easily be changed. But, "easily" is like that word
"simple". There's a deeper issue.
The problem can be seen in this example:
>> probe try [vista]
make error! [
near: [try [vista]]
The type for the error is identified by the word 'script. If your program
is handling its own errors, it may very well use that type field to figure
out how to proceed. Changing it to 'runtime would require changes to such
It also works the other way around. You can make your own error objects
by specifying the type, id, and arguments of the error. For example:
>> make error! [type: 'script id: 'no-value arg1: 'example]
** script error: example has no value
Here again the word 'script is important. It states the type of the
error, which indicates where the message itself can be found (within
the error message catalog.)
I guess we'll need to stick with "script errors" forever, right? Well,
we can debate it if you like. Now, with R3, this is the time.
Sure, in the bigger picture, it's a small thing. But, it does make a
nice, quick blog topic.
I'm open to your thoughts.
'Script is a good word here I think, unless you want to use 'program (which I don't). 'Runtime is a tricky concept, and could be applied, because what works in one place may not work in another. i.e. 'Script <> "compile-time".
out-of-memory is currently a script error, but seems more like an internal error to me, because it's not something I can control. That's what I see as the distinction. If I can avoid the error, but don't, it's a script error. If I choose to create an error myself, it's a user error. If it's not something I can control, it's an internal error. I think 'runtime is closer to 'internal than 'script.
I'm ok with keeping Script...
Maybe alias 'script "runtime" ? ;)
If you regret that naming decision, and you are readying a release which is going to break things, then for God sake, what's your dilemma? Just do what you think is best, which we are all sure is exactly what you're doing for R3.
When you PROBE VISTA, you got no value from it. But when you PROBE REBOL, you got all the value(s). The second sentence here is a pun as well.|
>> make money
** Script Error: money has no value
** Near: make money
I wish I could live like that. :-)
I think it doesn't really matter what it's called. During debugging, we see it so often we figure out its exact meaning empirically. It could be "Blark error" and not cause any great problem.
However, don't be afraid to change it because of compatibility breakage.|
|Steve, the eFishAnt|
While no one could argue that M$ Vista has no value...
Here is a suggestion for the wording, in REBOL dialect:
Invalid word error: vista not defined.
;on the other hand, if Vista were actually defined, then REBOL should say: Defective product warning: Vista should be recalled. Contact M$ and complain... ;-)
IMHO.runtime is too vague a word,
script error, really sounds like a syntax error.
why not say:
** evaluation error: vista currently has no value
the script is ok, its syntactically accurate, its actually able to start running it...
but its EVALUATION is not possible due to the context at that specific point in time not allowing you to *fullfill* that expression.
Run halted: vista returns no value
RUN HALTED: UNDEFINED vista returns no value
After all, don't words act as pointers or labels to functions?
RUN HALTED: vista must return a value
RUN HALTED: vista must have a define value to return
RUN HALTED: UNDEFINED vista. Nothing to return.
RUN HALTED: Cannot return UNDEFINED vista.
Post a Comment:
You can post a comment here. Keep it on-topic.