Call proper conversion function

This commit is contained in:
Justin Ethier 2020-05-12 18:12:14 -04:00
parent 1bd664b813
commit d62166d5d7
2 changed files with 4 additions and 4 deletions

View file

@ -203,7 +203,7 @@
var var
(cond (cond
(arg-cust-type (arg-cust-type
(if (= 3 (length arg-cust-type)) (if (> (length arg-cust-type) 1)
(set! arg-cust-convert #t)) (set! arg-cust-convert #t))
(car arg-cust-type)) (car arg-cust-type))
(else (else
@ -249,8 +249,8 @@
(hash-table-ref *foreign-types* (quote ,type))))) (hash-table-ref *foreign-types* (quote ,type)))))
(pass-arg (pass-arg
(if (and arg-cust-type (if (and arg-cust-type
(= 3 (length arg-cust-type))) (> (length arg-cust-type) 1))
`(,(caddr arg-cust-type) ,sym) `(,(cadr arg-cust-type) ,sym)
sym)) ) sym)) )
(cons (cons
sym ;; Arg sym ;; Arg

View file

@ -44,7 +44,7 @@
;(c-define scm-strlen "int" "strlen" string) ;(c-define scm-strlen "int" "strlen" string)
(c-define scm-strlend double "strlen" string) (c-define scm-strlend double "strlen" string)
(c-define scm-strlen2 integer "strlen" my-string) (c-define scm-strlen2 integer "strlen" my-string)
(c-define scm-strlen3 integer "strlen" my-integer-as-string) (c-define scm-strlen3 integer "strlen" string-as-integer)
(test-group "foreign lambda" (test-group "foreign lambda"
(test 15 (scm-strlen "testing 1, 2, 3")) (test 15 (scm-strlen "testing 1, 2, 3"))