diff options
Diffstat (limited to 'qklib/infix')
-rw-r--r-- | qklib/infix/rule-set.scm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/qklib/infix/rule-set.scm b/qklib/infix/rule-set.scm index 0c83d8d..70c3540 100644 --- a/qklib/infix/rule-set.scm +++ b/qklib/infix/rule-set.scm @@ -21,6 +21,7 @@ operator operator? operator-symbol + operator-prefix-symbol operator-precedence operator-left? operator-prefix @@ -67,8 +68,7 @@ (hashmap-unfold null? (lambda (ops) (let ((op (car ops))) - (values (cond ((operator-prefix op) => prefix-symbol) - (else (operator-symbol (car ops)))) + (values (operator-prefix-symbol op) (car ops)))) cdr ops @@ -105,6 +105,10 @@ (error "operator: The 3rd argument must be 'left or 'right" left-or-right)) (make-operator symbol precedence (eq? 'left left-or-right) unit prefix)))) + (define (operator-prefix-symbol op) + (cond ((operator-prefix op) => prefix-symbol) + (else (operator-symbol op)))) + (define-record-type <prefix> (make-prefix symbol flip?) prefix? |