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

View file

@ -44,7 +44,7 @@
;(c-define scm-strlen "int" "strlen" string)
(c-define scm-strlend double "strlen" 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 15 (scm-strlen "testing 1, 2, 3"))