Skip to content

Commit

Permalink
Add TYPE-OF-CONSTRUCTOR function.
Browse files Browse the repository at this point in the history
  • Loading branch information
takagi committed Dec 17, 2016
1 parent 36f4a4b commit 4e1bb29
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/lang/compiler/type-of-expression.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
((cuda-dimension-p form) (type-of-cuda-dimension form))
((reference-p form) (type-of-reference form var-env func-env))
((inline-if-p form) (type-of-inline-if form var-env func-env))
((constructor-p form) (type-of-constructor form var-env func-env))
((arithmetic-p form) (type-of-arithmetic form var-env func-env))
((function-p form) (type-of-function form var-env func-env))
(t (error "The value ~S is an invalid expression." form))))
Expand Down Expand Up @@ -165,6 +166,15 @@
then-type)))


;;;
;;; Vector constructors
;;;

(defun type-of-constructor (form var-env func-env)
;; Delegate the logic to TYPE-OF-FUNCTION for historical reasons.
(type-of-function form var-env func-env))


;;;
;;; Arithmetic operations
;;;
Expand Down
8 changes: 7 additions & 1 deletion t/lang/compiler/type-of-expression.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
:type-of-cuda-dimension
:type-of-reference
:type-of-inline-if
:type-of-constructor
:type-of-arithmetic
:type-of-function))
(in-package :cl-cuda-test.lang.compiler.type-of-expression)
Expand Down Expand Up @@ -155,7 +156,12 @@


;;;
;;; test TYPE-OF-ARITHMETIC function (not implemented)
;;; test TYPE-OF-CONSTRUCTOR function
;;;


;;;
;;; test TYPE-OF-ARITHMETIC function
;;;


Expand Down

0 comments on commit 4e1bb29

Please sign in to comment.