diff --git a/collects/honu/core/main.rkt b/collects/honu/core/main.rkt index f7aa0405e3..a64fdce75b 100644 --- a/collects/honu/core/main.rkt +++ b/collects/honu/core/main.rkt @@ -63,6 +63,7 @@ [honu-> >] [honu-< <] [honu->= >=] [honu-<= <=] + [honu-=> =>] ;; [honu-equal =] ;; [honu-assignment :=] [honu-map map] diff --git a/collects/honu/core/private/macro2.rkt b/collects/honu/core/private/macro2.rkt index 5ce81d6298..3e078f4961 100644 --- a/collects/honu/core/private/macro2.rkt +++ b/collects/honu/core/private/macro2.rkt @@ -156,7 +156,7 @@ ;; foo_a temp_a ;; (foo_b ...) (temp_b ...) (define (bind-attributes variable new-name) - (debug "Syntax class of ~a is ~a at ~a\n" + (debug 2 "Syntax class of ~a is ~a at ~a\n" (pattern-variable-class variable) (syntax-local-value (pattern-variable-class variable) (lambda () #f)) (syntax-local-phase-level)) @@ -170,7 +170,7 @@ #f)))) (define (mirror-attribute attribute) - (debug "Mirror attribute ~a\n" attribute) + (debug 2 "Mirror attribute ~a\n" attribute) (define-struct-fields attribute pattern-variable (name original depth class)) ;; create a new pattern variable with a syntax object that uses @@ -181,7 +181,7 @@ attribute.original attribute.depth attribute.class))) (define-struct-fields variable pattern-variable (name original depth class)) - (debug "Bind attributes ~a ~a\n" variable.name attribute.name) + (debug 2 "Bind attributes ~a ~a\n" variable.name attribute.name) (with-syntax ([bind-attribute #; (create name (syntax-e name) name) @@ -201,7 +201,7 @@ new-name attribute.name) attribute.original attribute.depth #f))]) - (debug "Bind ~a to ~a\n" #'bind-attribute #'new-attribute) + (debug 2 "Bind ~a to ~a\n" #'bind-attribute #'new-attribute) #'(#:with bind-attribute #'new-attribute))) (for/set ([attribute attributes]) @@ -378,7 +378,7 @@ (define mapping (make-hash)) (for ([old variables] [new use]) - (debug "Update mapping ~a to ~a\n" (syntax-e (pattern-variable-name old)) new) + (debug 2 "Update mapping ~a to ~a\n" (syntax-e (pattern-variable-name old)) new) (hash-set! mapping (syntax-e (pattern-variable-name old)) (pattern-variable new diff --git a/collects/honu/core/private/operator.rkt b/collects/honu/core/private/operator.rkt index 281005873f..003da6a875 100644 --- a/collects/honu/core/private/operator.rkt +++ b/collects/honu/core/private/operator.rkt @@ -131,3 +131,12 @@ (define-binary-operator honu-== 1 'left equal?) (define-binary-operator honu-not-equal 1 'left (lambda (left right) (not (equal? left right)))) + +(define-honu-operator/syntax honu-=> 0.00001 'left + (lambda (left right) + (when (not (identifier? left)) + (raise-syntax-error '=> "expected an identifier" left)) + (with-syntax ([left left] + [right right]) + (racket-syntax (lambda (left) + right)))))