|
From: miguel s. <mi...@ut...> - 2006-04-25 00:23:30
|
Neil Madden wrote:
> Hi all,
>
> I've been playing with [apply] (TIP 194) a lot recently, since it was
> added to the core. One thing I've noticed is that the error message it
> gives in the case of invalid arguments is rather unreadable, as it
> contains the full string representation of the body of the procedure. e.g.:
>
> % set func [list {a b} { ... a long body spanning multiple lines } ::]
> {a b} { ... a long body spanning multiple lines ... } ::
> % apply $func 12
> wrong # args: should be "apply {{a b} { ... a long body spanning
> multiple lines ... } ::} a b"
>
> On the one hand, this is helpful for debugging as you can see what the
> body of the procedure is (it might not be available otherwise, unlike a
> normal proc where you can use [info body]), but on the other it makes
> for fairly unreadable error messages (somewhat like C++ STL errors).
>
> Is it possible to change the error message to something a bit terser?
> For instance just something like:
>
> wrong # args: should be "<proc> a b"
> while applying procedure
> {{a b} { ... etc ... }}
> while executing
> apply $func 12
> ...
>
> i.e., move the more detailed message to ::errorInfo, and keep the
> initial error message short and to the point. What's the procedure for
> getting such a change made? Does it need a TIP amendment or new TIP ... ?
I do not think any TIP gymnastics will be needed here. I'll take a look
at what code contorsions could achieve this, and report back.
Miguel
|