aboutsummaryrefslogtreecommitdiff
path: root/src/boot/translator.boot.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/translator.boot.pamphlet')
-rw-r--r--src/boot/translator.boot.pamphlet16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/boot/translator.boot.pamphlet b/src/boot/translator.boot.pamphlet
index 50e146aa..c66ba1f2 100644
--- a/src/boot/translator.boot.pamphlet
+++ b/src/boot/translator.boot.pamphlet
@@ -375,7 +375,18 @@ shoeConsoleTrees s ==
s:=CDR s
shoeAddComment l== CONCAT('"; ",CAR l)
-
+
+++ Generate an import declaration for `op' as equivalent of the
+++ foreign signature `sig'. Here, `foreign' operationally means that
+++ the entity is from the C language world.
+genImportDeclaration(op, sig) ==
+ sig isnt ["Signature", op', m] => coreError '"invalid signature"
+ m isnt ["Mapping", t, s] => coreError '"invalid function type"
+ %hasFeature KEYWORD::GCL =>
+ if SYMBOLP s then s := [s]
+ ["DEFENTRY", op, s, [t, SYMBOL_-NAME op']]
+ fatalError '"import declaration not implemented for this Lisp"
+
shoeOutParse stream ==
$inputStream :local:= stream
$stack:local :=nil
@@ -415,6 +426,9 @@ bpOutItem()==
Import(m) =>
bpPush [["IMPORT-MODULE", m]]
+ ImportSignature(x, sig) =>
+ bpPush [genImportDeclaration(x, sig)]
+
TypeAlias(t, args, rhs) =>
bpPush [["DEFTYPE", t, args, ["QUOTE", rhs]]]