[honu] add assignment operator

This commit is contained in:
Jon Rafkind 2011-08-23 23:43:23 -06:00
parent b110671c5c
commit 6c75b60d1b
2 changed files with 8 additions and 1 deletions

View File

@ -136,6 +136,13 @@
[right right])
#'(right left))))
(provide honu-assignment)
(define-honu-operator/syntax honu-assignment 0.0001 'left
(lambda (left right)
(with-syntax ([left left]
[right right])
#'(set! left right))))
(define-binary-operator honu-+ 1 'left +)
(define-binary-operator honu-- 1 'left -)
(define-binary-operator honu-* 2 'left *)

View File

@ -34,7 +34,7 @@
(:~ #\")))
(define-lex-abbrev string (:: #\" (:* string-character) #\"))
(define-lex-abbrev operator (:or "+" "=" "*" "/" "-" "^" "||" "|" "&&" "<="
">=" "<-" "<" ">" "!" "::"))
">=" "<-" "<" ">" "!" "::" ":="))
(define-lex-abbrev block-comment (:: "/*"
(complement (:: any-string "*/" any-string))
"*/"))