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
(string-append c-func "(" cv-name tdata-comma tdata)))))
(else
(c-code (string-append c-func "(" tdata))))))
(c-code/vars
(string-append c-func "(" tdata tptr-comma tptr)
(list tptr-decl))))))
;; END primitives
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

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