issue #282 - Put numeric operations in body

This avoids ordering issues. But I think we still have trouble with other primtives. Is there ever a legitimate need to declare a c var for a prim??? I am not seeing it, especially with our changes now for Cyc-seq.
This commit is contained in:
Justin Ethier 2018-11-29 13:36:07 -05:00
parent 32a2024094
commit a918f2cb2d
2 changed files with 15 additions and 10 deletions

View file

@ -803,7 +803,9 @@
(list (list
(string-append c-func "(" cv-name tdata-comma tdata))))) (string-append c-func "(" cv-name tdata-comma tdata)))))
(else (else
(c-code (string-append c-func "(" tdata)))))) (c-code/vars
(string-append c-func "(" tdata tptr-comma tptr)
(list tptr-decl))))))
;; END primitives ;; END primitives
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -765,10 +765,11 @@
((eq? p 'Cyc-stderr) "port_type") ((eq? p 'Cyc-stderr) "port_type")
((eq? p 'open-input-file) "port_type") ((eq? p 'open-input-file) "port_type")
((eq? p 'open-output-file) "port_type") ((eq? p 'open-output-file) "port_type")
((eq? p 'Cyc-fast-plus) "object") ; TODO: can we remove all of these?? What actually needs to remain?
((eq? p 'Cyc-fast-sub) "object") ;((eq? p 'Cyc-fast-plus) "object")
((eq? p 'Cyc-fast-mul) "object") ;((eq? p 'Cyc-fast-sub) "object")
((eq? p 'Cyc-fast-div) "object") ;((eq? p 'Cyc-fast-mul) "object")
;((eq? p 'Cyc-fast-div) "object")
((eq? p '+) "object") ((eq? p '+) "object")
((eq? p '-) "object") ((eq? p '-) "object")
((eq? p '*) "object") ((eq? p '*) "object")
@ -836,10 +837,11 @@
make-vector list->vector make-vector list->vector
symbol->string number->string symbol->string number->string
substring substring
Cyc-fast-plus ; TODO: can we remove all of these?? What actually needs to remain?
Cyc-fast-sub ;Cyc-fast-plus
Cyc-fast-mul ;Cyc-fast-sub
Cyc-fast-div ;Cyc-fast-mul
;Cyc-fast-div
Cyc-fast-eq Cyc-fast-eq
Cyc-fast-gt Cyc-fast-gt
Cyc-fast-lt Cyc-fast-lt
@ -850,7 +852,8 @@
Cyc-fast-char-lt Cyc-fast-char-lt
Cyc-fast-char-gte Cyc-fast-char-gte
Cyc-fast-char-lte Cyc-fast-char-lte
+ - * / apply + - * /
apply
Cyc-fast-apply Cyc-fast-apply
= > < >= <= = > < >= <=
command-line-arguments command-line-arguments