The previous example now works. Thanks.
But here is a variation that still seg faults:
file1.rkt:
#lang racket
(require (for-syntax syntax/parse))
(provide (rename-out [my-define define]))
(define-syntax my-define
(syntax-parser
[(_ x:id e)
;; undef is unbound identifier
#:with y (local-expand #'undef 'expression null)
#'(void)]))
; (my-define X 1) produces: "undef: unbound identifier in module in: undef"
file2.rkt
#lang racket
(require "file1.rkt")
(define X 1)
Running file2.rkt in drracket with the new expander crashes drracket with:
SIGSEGV MAPERR si_code 1 fault on addr 0x20
Aborted
On Mon, Jul 20, 2015 at 3:49 PM, Matthew Flatt <[email protected]> wrote:
> I've just pushed a repair for this bug. Thanks for the report!
>
>
>
>> On Jul 20, 2015, at 12:47 PM, Stephen Chang <[email protected]> wrote:
>>
>> The following code produces a seg fault with the new expander (today's
>> build) in the scenario described below:
>>
>> file1.rkt:
>>
>> #lang racket
>> (require (for-syntax syntax/parse))
>>
>> (define-syntax (define-constructor stx)
>> (syntax-parse stx
>> [(_ X:id)
>> #'(define-syntax X
>> (syntax-parser
>> [(_ x (... ...)) #'(void x (... ...))]))]))
>>
>> (define-constructor C)
>>
>> (define-syntax define-alias
>> (syntax-parser
>> [(_ alias:id e)
>> #:with e+ (local-expand #'e 'expression null)
>> #'(define-syntax alias
>> (syntax-parser [x:id #'e+]))]))
>>
>> (define-alias D (C 1))
>>
>> file2.rkt:
>> (require "file1.rkt")
>>
>> A few notes:
>> - running file2.rkt in DrRacket with the new expander crashes drracket
>> with the error:
>>
>> SIGSEGV MAPERR si_code 1 fault on addr (nil)
>> Aborted
>>
>> - running file2.rkt with racket (new expander) produces no error
>> - running file2.rkt produced no error with the old expander
>> - running file1.rkt with either racket or drracket, new expander or
>> old expander, produces no error
>>
>> I'm not completely caught up with the new expander threads so
>> apologies in advance if someone has already raised this issue.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-dev/CAFfiA1LDBwHox-1iP9UdDQOKSLMU-TbhUVtbsd-TLrNNO0eB_g%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
--
You received this message because you are subscribed to the Google Groups
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-dev/CAFfiA1K%3D69XmcaZ53xHaonRyBXXBJmYuAo%3DZ%3DTXu%3DHmOHFmb%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.