I am currently coding with either Petite Scheme or MZScheme (have to use one of these), following the r5rs. DrScheme is a good UI, but I want to use Emacs most of the time, and only use DrScheme if harder bugs occur. Petite mostly complains that there was some error in #<procedure>, mzscheme does something similar. Well, ok, in scheme, since its a lisp-1, there is no way to always tell the current name of a function. But it would be nice to at least get the function name in some cases, i.e. when it has been defined by a define-statement, etc.
In general, it would be nice to have named stack frames in the debugger - even though that would mean that the code will be ran a lot faster. But since DrScheme can do these types of stuff, it should be somehow possible.
Does anybody know anything about this?
Getting the name of a #<procedure>
-
- Posts: 99
- Joined: Sat Jul 26, 2008 2:30 pm
- Location: Germany
- Contact:
Getting the name of a #<procedure>
Sorry for my bad english.
Visit my blog http://blog.uxul.de/
Visit my blog http://blog.uxul.de/
-
- Posts: 1
- Joined: Sat Dec 19, 2009 5:29 pm
- Contact:
Re: Getting the name of a #<procedure>
MzScheme will always give procedures a name according to the context that they were defined in -- either from a ‘define’ or a ‘let’ or any of their relatives. However, not all functions can be names in this way, for example, given ‘(foo 5)’ is a procedure that will not have a name.
And BTW, when you get a runtime error, DrScheme will generally give you much more information about where the error happened and draw arrows that represent the current stacktrace. You can get a similar kind of information in mzscheme if you run it with but it will be more difficult to read through traces.
Code: Select all
(define (foo x) (lambda () x))
And BTW, when you get a runtime error, DrScheme will generally give you much more information about where the error happened and draw arrows that represent the current stacktrace. You can get a similar kind of information in mzscheme if you run it with
Code: Select all
mz -lli errortrace scheme