[racket] How to make racket to show the call stack when get an exception?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sat Nov 23 10:15:40 EST 2013

We need a bit more information to help you because Racket provides precisely the information that you're looking for in DrRacket. Take this program: 

#lang racket

(sin
 (cos
  (tan
   (abs 
    (add1
     (sub1 
      ((list 1 2 3))))))))

Run it and you get 

> . . application: not a procedure;
>  expected a procedure that can be applied to arguments
>   given: '(1 2 3)
>   arguments...: [none]

The first icon gives you access to the complete stack. 

In a plain Racket replWelcome to Racket v5.90.0.11.
> (sin
    (cos
      (tan
	(abs 
	  (add1
	    (sub1 
	      ((list 1 2 3))))))))
application: not a procedure;
 expected a procedure that can be applied to arguments
  given: '(1 2 3)
  arguments...: [none]
  context...:
   /Users/matthias/plt/racket/collects/racket/private/misc.rkt:87:7

So what language are you specifying and in what context are you running the program? 

-- Matthias






On Nov 23, 2013, at 9:58 AM, Yu Yang wrote:

> when racket get an exception, it will show an error message like this 
> > procedure application: expected procedure, given: '(1 2 3) (no arguments)
> but this message seems too simple to figure out where the bug is. so I wan to know if there is any way to make racket show call stack, when it get an exception
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131123/3c2e275c/attachment-0001.html>

Posted on the users mailing list.