bugMIT/GNU Scheme - Bugs: bug #55200, 9.2 -> 10.1.3/10.1.90 breaks...

 
 

bug #55200: 9.2 -> 10.1.3/10.1.90 breaks `define-state-machine' macro

Submitter:  Arthur A. Gleckler <aag>
Submitted:  Tue 11 Dec 2018 04:13:39 AM UTC
   
 
Category:  runtime Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect behavior
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Closed
Keywords: 
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 22 Sep 2019 01:10:27 AM UTC, comment #3: 

Thank you!  This fixed the bug.

Arthur A. Gleckler <aag>
Group Member
Sat 21 Sep 2019 06:24:11 AM UTC, comment #2: 

I believe this is now fixed on HEAD.
Please check when you have some time.

Chris Hanson <cph>
Group administrator
Mon 07 Jan 2019 03:55:01 AM UTC, comment #1: 

I'm just wondering whether anyone has any ideas about this bug.  This macro failed after the fix for the previous bug.

Arthur A. Gleckler <aag>
Group Member
Tue 11 Dec 2018 04:13:39 AM UTC, original submission:  

When I upgraded to 10.1.3, my ancient `define-state-machine` macro broke.  I get this error when I try to compile the file that defines it:
```
;The object #[syntactic-closure 176 #[syntactic-closure 177 eof]], passed as an argument to lookup-identifier, is not the correct type.
```
I've pared down the macro and a trivial example of its use as much as possible to produce a relatively simple reproducible test case.  I've removed lots of clauses that don't fire, but I get the same result.  Here's the pared-down code:
```
(define-syntax define-state-machine
  (syntax-rules ()
    ((_ machine
        (end-state ...)
        (start-state . start-transitions)
        (state . transitions)
        ...)
     (define machine
       (letrec-syntax
           ((transform-non-eof-transitions
             (syntax-rules (eof)
               ((_ input ())
                (error condition-type:state-machine-error
                       'message "Unexpected character read."))
               ((_ input ((eof destination) . xitions))
                (_ input xitions))
               ((_ input ((edge destination) . xitions))
                (if (char-set-member? char-set:alphabetic input)
                    (begin
                      (write-char input)
                      (read-char)
                      (destination))
                    (_ input xitions)))))
            (transform-transitions
             (syntax-rules (eof)
               ((_ input xitions ())
                (if (eof-object? input)
                    (error condition-type:state-machine-error
                           'message "Unexpected end of file.")
                    (transform-non-eof-transitions input xitions)))
               ((_ input xitions ((eof destination) . remaining))
                (if (eof-object? input)
                    (destination)
                    (transform-non-eof-transitions input xitions)))
               ((_ input xitions ((edge destination . action) . remaining))
                (_ input xitions remaining)))))
         (letrec ((start-state
                   (lambda ()
                     (let ((input (peek-char)))
                       (transform-transitions input
                                              start-transitions
                                              start-transitions))))
                  (state
                   (lambda ()
                     (let ((input (peek-char)))
                       (transform-transitions input
                                              transitions
                                              transitions))))
                  ...
                  (end-state (lambda () 'end-state))
                  ...)
           start-state))))))

(define-state-machine test-machine (end)
  (start (alphabetic continue))
  (continue (alphabetic continue)
            (eof end)))
```
I've just built at commit `e3e8ca0cb`, and I get the same result.

Arthur A. Gleckler <aag>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #45622:  foo.scm added by aag (2KiB - application/octet-stream - I can't seem to figure out how to do formatting properly this time, so I've attached the code instead.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cph (Posted a comment)
  • -email is unavailable- added by aag (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-09-22 cph StatusNone Fixed
        Open/ClosedOpen Closed
    2018-12-11 aag Attached File- Added foo.scm, #45622

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code