mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Prevent a compiler error when there is only one argument to +
or *
.
This commit is contained in:
parent
142dbc3fb4
commit
4a3c68a7d3
3 changed files with 5 additions and 7 deletions
|
@ -11,6 +11,7 @@ Bug Fixes
|
|||
|
||||
- Made several improvements to macro hygiene by renaming local variable bindings during expansion. Added a unit test module covering many test cases.
|
||||
- Fixed many functions including `utf8->string`, `string->utf8`, `bytevector-copy`, `list->vector`, and `list->string` to heap allocate objects that exceed the maximum size for objects on the stack.
|
||||
- Prevent a compiler error when there is only one argument to `+` or `*`.
|
||||
|
||||
## 0.7.1 - December 21, 2017
|
||||
|
||||
|
|
|
@ -910,6 +910,8 @@
|
|||
|
||||
(define (prim:inline-convert-prim-call prim-call)
|
||||
(cond
|
||||
((and (equal? (car prim-call) '+) (= (length prim-call) 2)) `(Cyc-fast-plus 0 ,@(cdr prim-call)))
|
||||
((and (equal? (car prim-call) '*) (= (length prim-call) 2)) `(Cyc-fast-mul 1 ,@(cdr prim-call)))
|
||||
((equal? (car prim-call) '+) (->dyadic (cons 'Cyc-fast-plus (cdr prim-call))))
|
||||
((equal? (car prim-call) '*) (->dyadic (cons 'Cyc-fast-mul (cdr prim-call))))
|
||||
((and (equal? (car prim-call) '-) (= (length prim-call) 2)) `(Cyc-fast-sub 0 ,@(cdr prim-call))) ;; Special case, fast negation
|
||||
|
|
|
@ -95,13 +95,8 @@
|
|||
(match
|
||||
lst
|
||||
;(() 0)
|
||||
;; Temporarily commenting these 2 lines out to track down compiler error with the next:
|
||||
; (((? number? n) (or 's 'seconds 'sec) . rest)
|
||||
; (+ 0 (* #e1 n) (calc-time rest)))
|
||||
;; TODO: interesting compiler error with these lines:
|
||||
(((? number? n) (or 's 'seconds 'sec) ) ;. rest)
|
||||
(+ (* #e1 n) )) ;(calc-time rest)))
|
||||
;;
|
||||
(((? number? n) (or 's 'seconds 'sec) . rest)
|
||||
(+ 0 (* #e1 n) (calc-time rest)))
|
||||
(((? number? n) (or 'm 'min 'minutes) . rest)
|
||||
(+ (* #e60 n) (calc-time rest)))
|
||||
(((? number? n) (or 'hours 'h) . rest)
|
||||
|
|
Loading…
Add table
Reference in a new issue