[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [FEATURE] List all available languages
From: |
Mark H Weaver |
Subject: |
Re: [FEATURE] List all available languages |
Date: |
Fri, 25 Jan 2013 17:50:42 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
I wrote:
> How about adding a new boolean field to <language> that marks it as
> "internal" or something to that effect? We could have it default to #f
> for backward compatibility, and mark our internal languages as #t.
I've attached a proposed patch to add this field. Thoughts?
Mark
>From 605cbde174afa52d4ccfd8528ef6903ad98a8002 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <address@hidden>
Date: Fri, 25 Jan 2013 17:44:14 -0500
Subject: [PATCH] Add 'internal-only?' flag to <language> specifications.
* module/system/base/language.scm (<language>): Add 'internal-only?'
field, and export new 'language-internal-only?' predicate.
* doc/ref/compiler.texi (Compiler Tower): Document.
* module/language/assembly/spec.scm, module/language/bytecode/spec.scm,
module/language/glil/spec.scm, module/language/objcode/spec.scm,
module/language/tree-il/spec.scm, module/language/value/spec.scm:
Mark these languages as 'internal-only?'.
---
doc/ref/compiler.texi | 3 ++-
module/language/assembly/spec.scm | 1 +
module/language/bytecode/spec.scm | 1 +
module/language/glil/spec.scm | 4 +++-
module/language/objcode/spec.scm | 1 +
module/language/tree-il/spec.scm | 1 +
module/language/value/spec.scm | 1 +
module/system/base/language.scm | 4 +++-
8 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/doc/ref/compiler.texi b/doc/ref/compiler.texi
index a88942d..46cde8c 100644
--- a/doc/ref/compiler.texi
+++ b/doc/ref/compiler.texi
@@ -55,7 +55,8 @@ They are registered with the @code{define-language} form.
@deffn {Scheme Syntax} define-language @
name title reader printer @
[parser=#f] [compilers='()] [decompilers='()] [evaluator=#f] @
-[joiner=#f] [make-default-environment=make-fresh-user-module]
+[joiner=#f] [internal-only?=#f] @
+[make-default-environment=make-fresh-user-module]
Define a language.
This syntax defines a @code{#<language>} object, bound to @var{name}
diff --git a/module/language/assembly/spec.scm
b/module/language/assembly/spec.scm
index 01a55c4..a5efcb7 100644
--- a/module/language/assembly/spec.scm
+++ b/module/language/assembly/spec.scm
@@ -31,4 +31,5 @@
#:parser read ;; fixme: make a verifier?
#:compilers `((bytecode . ,compile-bytecode))
#:decompilers `((bytecode . ,decompile-bytecode))
+ #:internal-only? #t
)
diff --git a/module/language/bytecode/spec.scm
b/module/language/bytecode/spec.scm
index 57ccd71..af2f9c7 100644
--- a/module/language/bytecode/spec.scm
+++ b/module/language/bytecode/spec.scm
@@ -35,4 +35,5 @@
#:printer write
#:compilers `((objcode . ,compile-objcode))
#:decompilers `((objcode . ,decompile-objcode))
+ #:internal-only? #t
)
diff --git a/module/language/glil/spec.scm b/module/language/glil/spec.scm
index a8164e5..3faa9b9 100644
--- a/module/language/glil/spec.scm
+++ b/module/language/glil/spec.scm
@@ -37,4 +37,6 @@
#:printer write-glil
#:parser parse-glil
#:compilers `((assembly . ,compile-asm))
- #:decompilers `((assembly . ,decompile-assembly)))
+ #:decompilers `((assembly . ,decompile-assembly))
+ #:internal-only? #t
+ )
diff --git a/module/language/objcode/spec.scm b/module/language/objcode/spec.scm
index 7cc85b7..a17166a 100644
--- a/module/language/objcode/spec.scm
+++ b/module/language/objcode/spec.scm
@@ -79,4 +79,5 @@
#:printer write-objcode
#:compilers `((value . ,objcode->value))
#:decompilers `((value . ,decompile-value))
+ #:internal-only? #t
)
diff --git a/module/language/tree-il/spec.scm b/module/language/tree-il/spec.scm
index 38e6d31..eae93b6 100644
--- a/module/language/tree-il/spec.scm
+++ b/module/language/tree-il/spec.scm
@@ -42,4 +42,5 @@
#:parser parse-tree-il
#:joiner join
#:compilers `((glil . ,compile-glil))
+ #:internal-only? #t
)
diff --git a/module/language/value/spec.scm b/module/language/value/spec.scm
index 6c6cff9..26823ca 100644
--- a/module/language/value/spec.scm
+++ b/module/language/value/spec.scm
@@ -26,4 +26,5 @@
#:title "Values"
#:reader #f
#:printer write
+ #:internal-only? #t
)
diff --git a/module/system/base/language.scm b/module/system/base/language.scm
index 81b43b7..8949c05 100644
--- a/module/system/base/language.scm
+++ b/module/system/base/language.scm
@@ -25,7 +25,8 @@
language-name language-title language-reader
language-printer language-parser
language-compilers language-decompilers language-evaluator
- language-joiner language-make-default-environment
+ language-joiner language-internal-only?
+ language-make-default-environment
lookup-compilation-order lookup-decompilation-order
invalidate-compilation-cache! default-environment
@@ -49,6 +50,7 @@
(decompilers '())
(evaluator #f)
(joiner #f)
+ (internal-only? #f)
(make-default-environment make-fresh-user-module))
(define-macro (define-language name . spec)
--
1.7.10.4
- [FEATURE] List all available languages, Nala Ginrut, 2013/01/23
- Re: [FEATURE] List all available languages, Nala Ginrut, 2013/01/25
- Re: [FEATURE] List all available languages, Nala Ginrut, 2013/01/25
- Re: [FEATURE] List all available languages, Mark H Weaver, 2013/01/25
- Re: [FEATURE] List all available languages,
Mark H Weaver <=
- Re: [FEATURE] List all available languages, Nala Ginrut, 2013/01/25
- Re: [FEATURE] List all available languages, Andy Wingo, 2013/01/27
- Re: [FEATURE] List all available languages, Mark H Weaver, 2013/01/27