graphical debugging

39 views
Skip to first unread message

Catonano

unread,
Aug 29, 2020, 5:20:48 AM8/29/20
to Racket Users
in Drracket, I'm trying to debug this scrap of code

#lang racket
 
(require racket/string sxml)
 
(define (remove-markup xml-port)
  (let* ((parser
          (ssax:make-parser NEW-LEVEL-SEED remove-markup-nls
                            FINISH-ELEMENT remove-markup-fe
                            CHAR-DATA-HANDLER remove-markup-cdh))
         (strings (parser xml-port null)))
    (string-join (reverse strings) "")))
 
(define (remove-markup-nls gi attributes namespaces expected-content
                           seed)
  seed)
 
(define (remove-markup-fe gi attributes namespaces parent-seed seed)
  seed)
 
(define (remove-markup-cdh string-1 string-2 seed)
  (let ((seed (cons string-1 seed)))
    (if (non-empty-string? string-2)
        (cons string-2 seed)
        seed)))
 
(remove-markup
 (open-input-string
  "<foo>Hell<bar>o, world!</bar></foo>"))

it's an example copied from here

Reading here
https://docs.racket-lang.org/drracket/debugger.html

I understand that a little green triangular arrow should appear on the left side of the line where the debugger stops and waits

but that doesn't happen to me, it runs completely and produces the output (he "Hello World !" string)

am I doing anything wrong ?

Thanks

Sorawee Porncharoenwase

unread,
Aug 29, 2020, 6:11:25 AM8/29/20
to Catonano, Racket Users

It (kinda) works for me. You should make sure that debugging is enabled in the language setting (it should display something like “Language: racket, with debugging [custom]” in the REPL). Then, click “Debug” and then click “Step” for a couple of times (seven to be precise). The little green triangular arrow should then appear at

--
You received this message because you are subscribed to the Google Groups "Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to racket-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAJ98PDxXRHuH47tUBSUe1PLeywAY0fRN1Y4w6kn8mubLUt0HWw%40mail.gmail.com.

Catonano

unread,
Aug 29, 2020, 8:21:41 AM8/29/20
to Sorawee Porncharoenwase, Racket Users
Il giorno sab 29 ago 2020 alle ore 12:11 Sorawee Porncharoenwase <sorawe...@gmail.com> ha scritto:

It (kinda) works for me. You should make sure that debugging is enabled in the language setting (it should display something like “Language: racket, with debugging [custom]” in the REPL). Then, click “Debug” and then click “Step” for a couple of times (seven to be precise). The little green triangular arrow should then appear at

(remove-markup
 (open-input-string
  "<foo>Hell<bar>o, world!</bar></foo>"))





Thank you very much

How do I enable debigging in the repl ?

This is all my repl shows

~$ racket
Welcome to Racket v7.7.
>


Sorawee Porncharoenwase

unread,
Aug 29, 2020, 10:03:03 AM8/29/20
to Catonano, Racket Users
I meant the REPL in DrRacket (interaction window).
Reply all
Reply to author
Forward
0 new messages