Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
974589fd
Commit
974589fd
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2005-03-04 15:26:27 by afrisch] #builtins directive
Original author: afrisch Date: 2005-03-04 15:26:28+00:00
parent
6a2af5ae
Changes
8
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
974589fd
...
...
@@ -70,14 +70,15 @@ package: clean
#cvs_snapshot:
# $(MAKE) package VERSION=cvs`date +%Y%m%d`
MSTONE
=
2
cvs_snapshot
:
(
cd
/tmp
;
\
rm
-Rf
cduce
;
\
cvs
-z3
-d
":pserver:anonymous@cvs.cduce.org:/cvsroot"
co cduce
;
\
tar
czf cduce-cvs.tar.gz cduce
;
\
tar
czf cduce-cvs
$(MSTONE)
.tar.gz cduce
;
\
rm
-Rf
cduce
;
\
scp cduce-cvs.tar.gz cduce@iris.ens.fr:public_html/download
;
\
rm
-f
cduce-cvs.tar.gz
)
scp cduce-cvs
$(MSTONE)
.tar.gz cduce@iris.ens.fr:public_html/download
;
\
rm
-f
cduce-cvs
$(MSTONE)
.tar.gz
)
OCAML_STDLIBDIR
:=
$(
shell
ocamlc
-where
)
.PHONY
:
.ocamlinit
...
...
driver/cduce.ml
View file @
974589fd
...
...
@@ -265,6 +265,11 @@ let directive ppf tenv cenv = function
silent
:=
true
|
`Verbose
->
silent
:=
false
|
`Builtins
->
let
b
=
Librarian
.
get_builtins
()
in
Format
.
fprintf
ppf
"Embedded OCaml value: "
;
List
.
iter
(
fun
s
->
Format
.
fprintf
ppf
"%s "
s
)
b
;
Format
.
fprintf
ppf
"@."
let
print_id_opt
ppf
=
function
|
None
->
Format
.
fprintf
ppf
"-"
...
...
driver/librarian.ml
View file @
974589fd
...
...
@@ -283,6 +283,10 @@ let static_externals = Hashtbl.create 17
let
register_static_external
n
v
=
Hashtbl
.
add
static_externals
n
v
let
get_builtins
()
=
List
.
sort
Pervasives
.
compare
(
Hashtbl
.
fold
(
fun
n
_
accu
->
n
::
accu
)
static_externals
[]
)
let
()
=
Typer
.
from_comp_unit
:=
(
fun
cu
->
(
load
cu
)
.
typing
);
Typer
.
has_comp_unit
:=
has_obj
;
...
...
driver/librarian.mli
View file @
974589fd
...
...
@@ -29,4 +29,4 @@ val stub_ml : (string -> Typer.t -> Compile.env ->
stub_ml
option
*
Types
.
t
array
)
ref
val
register_static_external
:
string
->
Value
.
t
->
unit
val
get_builtins
:
unit
->
string
list
parser/ast.ml
View file @
974589fd
...
...
@@ -35,6 +35,7 @@ and toplevel_directive =
|
`Debug
of
debug_directive
|
`Verbose
|
`Silent
|
`Builtins
]
...
...
parser/parser.ml
View file @
974589fd
...
...
@@ -159,6 +159,7 @@ EXTEND
|
"#"
;
IDENT
"dump_value"
;
e
=
expr
->
[
mk
loc
(
Directive
(
`Dump
e
))
]
|
"#"
;
IDENT
"reinit_ns"
->
[
mk
loc
(
Directive
`Reinit_ns
)
]
|
"#"
;
IDENT
"help"
->
[
mk
loc
(
Directive
`Help
)
]
|
"#"
;
IDENT
"builtins"
->
[
mk
loc
(
Directive
`Builtins
)
]
|
"include"
;
s
=
STRING2
->
let
s
=
if
Filename
.
is_relative
s
...
...
web/manual/interface.xml
View file @
974589fd
...
...
@@ -374,6 +374,11 @@ the name of an OCaml unit (like <code>List</code>). Empty lines
and lines starting with a sharp character are ignored.
</p>
<p>
In a custom toplevel, the directive
<code>
#builtins
</code>
prints the name
of embedded OCaml values.
</p>
</box>
<box
title=
"Examples"
link=
"examples"
>
...
...
web/manual/interpreter.xml
View file @
974589fd
...
...
@@ -250,6 +250,11 @@ values and types with namespaces (see <local href="namespaces"/>).
Schema
</local>
documents).
</p>
<p>
The toplevel directive
<code>
#builtins
</code>
prints the name
of embedded OCaml values (see
<local
href=
"manual_interfacewithocaml"
/>
).
</p>
<p>
The toplevel has no line editing facilities.
You can use an external wrapper such as
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment