Fix a few minor bugs in the chicken module

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7690 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
John Lenz 2005-10-20 00:37:57 +00:00
commit d966db961c
3 changed files with 25 additions and 24 deletions

View file

@ -7,34 +7,34 @@
(display (gcd 90 12))
(display "\n")
(display "(gcd 90 'a): ")
;;(display (gcd 90 'a))
(display "\n")
(display "(gcd 'b 12): ")
;;(display (gcd 'b 12))
(display "\n")
(display "(circle 0.5 0.5): ")
(circle 0.5 0.5)
(display (circle 0.5 0.5))
(display "\n")
(display "(circle 1.0 1.0): ")
;;(circle 1.0 1.0)
(handle-exceptions exvar
(if (= (car exvar) 9)
(display "success: exception thrown")
(display "an incorrect exception was thrown"))
(begin
(circle 1.0 1.0)
(display "an exception was not thrown when it should have been")))
(display "\n")
(display "(circle 1 1): ")
;;(circle 1 1)
(handle-exceptions exvar
(if (= (car exvar) 9)
(display "success: exception thrown")
(display "an incorrect exception was thrown"))
(begin
(circle 1 1)
(display "an exception was not thrown when it should have been")))
(display "\n")
(display "(capitalize \"will this be all capital letters?\"): ")
(display (capitalize "will this be all capital letters?"))
(display "\n")
(display "(capitalize 'a): ")
;;(display (capitalize 'a))
(display "\n")
(display "(count \"jumpity little spider\" #\\t): ")
(display (count "jumpity little spider" #\t))
(display "\n")
@ -51,7 +51,7 @@
(gcdmain '#("gcd" "12" "90"))
(display "\n")
(display "(squarecubed 3: ")
(display "squarecubed 3: ")
(call-with-values (lambda() (squareCubed 3))
(lambda (a b) (printf "~A ~A" a b)))
(display "\n")

View file

@ -61,16 +61,17 @@ extern "C" {
continuation=(C_word)closure; \
}
#define SWIG_APPEND_VALUE(obj) \
if (obj != C_SCHEME_UNDEFINED) { \
#define SWIG_APPEND_VALUE(obj) { \
C_word val = (C_word)(obj); \
if (val != C_SCHEME_UNDEFINED) { \
C_word *a = C_alloc(C_swig_sizeof_closure(3)); \
C_word *closure = a; \
*(a++)=C_CLOSURE_TYPE|3; \
*(a++)=(C_word)SWIG_Chicken_MultiResultBuild; \
*(a++)=(C_word)continuation; \
*(a++)=(C_word)(obj); \
*(a++)=val; \
continuation=(C_word)closure; \
}
} }
#define SWIG_Chicken_FindCreateProxy(func,obj) \
if (C_swig_is_swigpointer(obj)) { \
@ -357,7 +358,7 @@ static C_word SWIG_Chicken_MultiResultBuild(C_word num, C_word closure, C_word l
}
}
C_word SWIG_Chicken_ApplyResults(C_word num, C_word closure, C_word result) {
static C_word SWIG_Chicken_ApplyResults(C_word num, C_word closure, C_word result) {
C_apply_values(3,C_SCHEME_UNDEFINED,C_block_item(closure,1),result);
}

View file

@ -605,7 +605,7 @@ CHICKEN::functionWrapper(Node *n)
"C_word func;\n",
"SWIG_Chicken_FindCreateProxy(func, resultobj)\n",
"if (C_swig_is_closurep(func))\n",
" ((C_proc3)(void *)C_block_item(func, 0))(4,func,continuation,resultobj,C_SCHEME_FALSE);\n",
" ((C_proc4)(void *)C_block_item(func, 0))(4,func,continuation,resultobj,C_SCHEME_FALSE);\n",
"else\n",
" C_kontinue(continuation, resultobj);\n",
"}\n", NIL);
@ -807,7 +807,7 @@ CHICKEN::variableWrapper(Node *n) {
"C_word func;\n",
"SWIG_Chicken_FindCreateProxy(func, resultobj)\n",
"if (C_swig_is_closurep(func))\n",
" ((C_proc3)(void *)C_block_item(func, 0))(4,func,continuation,resultobj,C_SCHEME_FALSE);\n",
" ((C_proc4)(void *)C_block_item(func, 0))(4,func,continuation,resultobj,C_SCHEME_FALSE);\n",
"else\n",
" C_kontinue(continuation, resultobj);\n",
"}\n", NIL);
@ -993,7 +993,7 @@ CHICKEN::constantWrapper(Node *n)
"C_word func;\n",
"SWIG_Chicken_FindCreateProxy(func, resultobj)\n",
"if (C_swig_is_closurep(func))\n",
" ((C_proc3)(void *)C_block_item(func, 0))(4,func,continuation,resultobj,C_SCHEME_FALSE);\n",
" ((C_proc4)(void *)C_block_item(func, 0))(4,func,continuation,resultobj,C_SCHEME_FALSE);\n",
"else\n",
" C_kontinue(continuation, resultobj);\n",
"}\n", NIL);