Closed harryfei closed 6 years ago
I don't think this is the correct solution. We should be attaching paren-shape
properties properly.
However, the correct property value for round parens is not #\(
, but #false
. We should fix that in the paren-shape
function in sweet-exp-lib/sweet-exp/util.rkt
.
Something like:
(define (paren-shape stx shape)
(define val
(cond [(char=? shape #\( ) #false] [else shape]))
(syntax-property stx 'paren-shape val))
So that round parens correspond to a #false
property value as they're supposed to.
Does the sweet-exp hackett
program you were testing work now? This simple one works for me:
#lang sweet-exp hackett
defn f
[0] 1
[n] {n * f{n - 1}}
main
print
show f(4)
@AlexKnauth Thanks. You are right. It works to use the latest new sweet-exp
version.
So close this PR.
I found that it does't work when using
sweet-racket
withhackett
together like below.I digged into the code and found the issue is caused by those unnecessary
paren-shape
call.After removing them, everything is fine.