bugMIT/GNU Scheme - Bugs: bug #65272, Attempting to define macro with...

 
 

bug #65272: Attempting to define macro with keyword "if" using define-syntax results in error.

Submitter:  None
Submitted:  Thu 08 Feb 2024 12:24:00 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect behavior
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  Richard
Originator Email:  -email is unavailable- Open/Closed:  Open
Keywords: 
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 08 Feb 2024 12:24:00 AM UTC, original submission:  

Discussed here: https://stackoverflow.com/questions/77957401/why-cant-a-scheme-macro-with-the-name-if-be-defined

Incorrect behavior, running on MIT/GNU Scheme 12.1:

1 ]=> (define-syntax if
        (syntax-rules ()
          ((_) 'ok)))

;Premature reference to reserved name: if
;To continue, call RESTART with an option number:
; (RESTART 1) => Return to read-eval-print level 1.


Correct behavior:

1 ]=> (define-syntax if
        (syntax-rules ()
          ((_) 'ok)))

;Value: if

1 ]=> (if)

;Value: ok


Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

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.

 

No changes have been made to this item

Back to the top

Powered by Savane 3.13-8ccc.
Corresponding source code