Thanks to Thomas Weidner.
- when feature export is set (export 'foo) is generated for every symbol, i think should be external. - when feature inline is set (declaim (inline foo)) is generated before every function definition - when feature intern_function is set #.(value-of-intern-function "name" "nodeType" package) is emitted instead of the plain symbol. a sample swig-lispify is provided. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9059 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
82f7f3066a
commit
9af1e0981c
2 changed files with 117 additions and 22 deletions
|
|
@ -107,5 +107,40 @@
|
|||
value (cl:first value))
|
||||
collect `(cl:defconstant ,value ,index))))
|
||||
|
||||
(cl:eval-when (:compile-toplevel :load-toplevel)
|
||||
(cl:unless (cl:fboundp 'swig-lispify)
|
||||
(cl:defun swig-lispify (name flag cl:&optional (package cl:*package*))
|
||||
(cl:labels ((helper (lst last rest cl:&aux (c (cl:car lst)))
|
||||
(cl:cond
|
||||
((cl:null lst)
|
||||
rest)
|
||||
((cl:upper-case-p c)
|
||||
(helper (cl:cdr lst) 'upper
|
||||
(cl:case last
|
||||
((lower digit) (cl:list* c #\- rest))
|
||||
(cl:t (cl:cons c rest)))))
|
||||
((cl:lower-case-p c)
|
||||
(helper (cl:cdr lst) 'lower (cl:cons (cl:char-upcase c) rest)))
|
||||
((cl:digit-char-p c)
|
||||
(helper (cl:cdr lst) 'digit
|
||||
(cl:case last
|
||||
((upper lower) (cl:list* c #\- rest))
|
||||
(cl:t (cl:cons c rest)))))
|
||||
((cl:char-equal c #\_)
|
||||
(helper (cl:cdr lst) '_ (cl:cons #\- rest)))
|
||||
(cl:t
|
||||
(cl:error "Invalid character: ~A" c)))))
|
||||
(cl:let ((fix (cl:case flag
|
||||
((constant enumvalue) "+")
|
||||
(variable "*")
|
||||
(cl:t ""))))
|
||||
(cl:intern
|
||||
(cl:concatenate
|
||||
'cl:string
|
||||
fix
|
||||
(cl:nreverse (helper (cl:concatenate 'cl:list name) cl:nil cl:nil))
|
||||
fix)
|
||||
package))))))
|
||||
|
||||
;;;SWIG wrapper code ends here
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue