Request: trace-let-syntax & trace-letrec-syntax

Bug #247558 reported by leppie
2
Affects Status Importance Assigned to Milestone
Ikarus Scheme
Fix Committed
Wishlist
Abdulaziz Ghuloum

Bug Description

Hi

Would it be possible to have tracing for let-syntax and letrec-syntax?

Or maybe someone can suggest another way?

Cheers

leppie

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 247558] [NEW] Request: trace-let-syntax & trace-letrec-syntax

On Jul 11, 2008, at 4:18 AM, leppie wrote:

> Would it be possible to have tracing for let-syntax and letrec-syntax?

You mean the same as trace-define-syntax for let-syntax and letrec-
syntax?

Revision history for this message
leppie (leppie) wrote :

> You mean the same as trace-define-syntax for let-syntax and letrec-
> syntax?

Yes, that is correct.

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 247558] Re: Request: trace-let-syntax & trace-letrec-syntax

This should be easy to add.

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 247558] [NEW] Request: trace-let-syntax & trace-letrec-syntax

On Jul 11, 2008, at 4:18 AM, leppie wrote:

> Or maybe someone can suggest another way?

(define-syntax trace-let-syntax
   (syntax-rules ()
     [(_ ([lhs* rhs*] ...) b b* ...)
      (let-syntax ([lhs* (make-traced-procedure 'lhs* rhs* syntax-
 >datum)]
                   ...)
        b b* ...)]))

not tested.

Changed in ikarus:
assignee: nobody → aghuloum
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
leppie (leppie) wrote :

Cool, thanks, I'll give it a go :)

Revision history for this message
leppie (leppie) wrote :

I am getting the following:

> (load "c:/Program Files/xacc.ide/defmethod.ss")
|(a a)
Unhandled exception
 Condition components:
   1. &assertion
   2. &who: apply
   3. &message: "not a procedure"
   4. &irritants: ((macro! . #<procedure>))
>

File attached.

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 247558] Re: Request: trace-let-syntax & trace-letrec-syntax

On Jul 11, 2008, at 12:24 PM, leppie wrote:

> Unhandled exception
> Condition components:
> 1. &assertion
> 2. &who: apply
> 3. &message: "not a procedure"
> 4. &irritants: ((macro! . #<procedure>))

That's also a bug in ikarus.

Will fix both. In the meantime:

(define (make-traced-macro name x)
   ;;; nonportable
   (define (variable-transformer? x)
     (and (pair? x) (procedure? (cdr x))))
   (define variable-transformer-procedure cdr)
   (cond
     [(procedure? x) (make-traced-procedure name x syntax->datum)]
     [(variable-transformer? x)
      (make-variable-transformer
        (make-traced-procedure name
          (variable-transformer-procedure x)
          syntax->datum))]
     [else #|no trace|# x]))

(define-syntax trace-let-syntax
   (syntax-rules ()
     [(_ ([lhs* rhs*] ...) b b* ...)
      (let-syntax ([lhs* (make-traced-macro 'lhs* rhs*)] ...)
        b b* ...)]))

Revision history for this message
leppie (leppie) wrote :

> Will fix both. In the meantime:

Thanks, no rush :-)

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

Fixed both in 1535.

Changed in ikarus:
status: Confirmed → Fix Committed
Revision history for this message
leppie (leppie) wrote :

> Fixed both in 1535.

Not quite ;P

Doing 'trace-define-syntax method' now spews out a lot of syntax records. Missing a filter?

Revision history for this message
leppie (leppie) wrote :

Here the fix, missed the syntax->datum :)

  (define make-traced-macro
    (lambda (name x)
      (cond
        [(procedure? x)
         (make-traced-procedure name x syntax->datum)]
        [(variable-transformer? x)
         (make-variable-transformer
           (make-traced-procedure name
             (variable-transformer-procedure x)
             syntax->datum))]
        [else x]))))

Revision history for this message
leppie (leppie) wrote :

Hehe, and thats exactly how you had it originally.

Changed in ikarus:
milestone: none → 0.0.4
Revision history for this message
Tom Gordon (tom-gordon) wrote : VIM Settings for Ikarus

Dear Aziz,

I'm becoming increasingly frustrated with PLT's support, or lack
thereof, for R6RS. The most recent version is broken. I suppose it
will be repaired soon, but this occassion makes once again think about
alternative editors or development environments. I'd like to switch
to using either Ikarus or Ypsilon for development. I see that you've
been developing some basic debugging tools, which is very encouraging.

But which editor? I use to be a vi user, for about 10 years, but that
was years ago. I understand you are a vim user. Could you give me
some hints about how you have customized vim for programming in
Scheme? I'd like to give it a try.

Many thanks,

Tom

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.