List Info

Thread: "ocaml_beginners"::[] stream syntax




"ocaml_beginners"::[] stream syntax
user name
2006-11-23 19:06:22

Hello

cam somebody tell me why Syntax error here :
loc>ocaml
Objective Caml version 3.09.2

# [< >] ;;
Syntax error

Thanks
François Colonna

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] stream syntax
user name
2006-11-23 19:40:51

2006/11/23, Francois Colonna < colonna%40ccr.jussieu.fr">colonnaccr.jussieu.fr>:
> Objective Caml version 3.09.2
&gt;
> # [< >] ;;
> Syntax error

you need camlp4 :
Objective Caml version 3.09.2

# [< >];;
Syntax error
# #load "camlp4o.cma&quot;;;
Camlp4 Parsing version 3.09.2

# [< >];;
- : 'a Stream.t = <abstr&gt;

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] stream syntax
user name
2006-11-23 19:44:09

See there: http://caml.inria.fr/pub/docs/manual-ocaml/manual021.html#htoc93

You have to load the camlp4o module to use this syntax.

Objective Caml version 3.09.2

# #load "camlp4o.cma&quot;;;
Camlp4 Parsing version 3.09.2

# [<>];;
- : 'a Stream.t = <abstr&gt;

Salutations

Matt

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] stream syntax
user name
2006-11-23 19:54:22

Remi Vanicat wrote:
&gt; 2006/11/23, Francois Colonna < colonna%40ccr.jussieu.fr">colonnaccr.jussieu.fr>:
>
>> Objective Caml version 3.09.2
&gt;>
>;> # [< >] ;;
>&gt; Syntax error
>;>
>
&gt; you need camlp4 :
> Objective Caml version 3.09.2
&gt;
> # [< >];;
&gt; Syntax error
>; # #load "camlp4o.cma&quot;;;
> Camlp4 Parsing version 3.09.2
&gt;
> # [< >];;
&gt; - : 'a Stream.t = <abstr&gt;
>
>
Thanks.
F. Colonna

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] stream syntax
user name
2006-11-23 20:19:21

Francois Colonna:
> loc>ocaml
> Objective Caml version 3.09.2
&gt;
> # [< >] ;;
> Syntax error

thierrybrume ~ $ ocaml
Objective Caml version 3.09.2

# #load "camlp4o.cma&quot;;;
Camlp4 Parsing version 3.09.2

# [< >];;
- : 'a Stream.t = <abstr&gt;

--
Thierry.

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] stream syntax again
user name
2006-11-24 10:46:40

Hello

adding #load "camlp4o.cma&quot;;;
helps in the socalled toplevel mode not in "batch" mode.
the file stream.ml

loc>cat stream.ml
(**
* stream problem
*)
#load "camlp4o.cma&quot;;;
[<; >];;

which gives
# [< >];;
- : 'a Stream.t = <abstr&gt;

with tuareg, gives

loc>ocaml stream.ml
File "stream.ml", line 6, characters 0-2:
Syntax error

when using ocaml.

thanks for helping.

François Colonna

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] stream syntax again
user name
2006-11-24 11:47:29

Francois Colonna a écrit :
> Hello
>;
> adding #load "camlp4o.cma&quot;;;
> helps in the socalled toplevel mode not in "batch" mode.
>; the file stream.ml
>
> loc>cat stream.ml
> (**
> * stream problem
&gt; *)
> #load "camlp4o.cma&quot;;;
> [< >];;
&gt;
>
> which gives
>; # [< >];;
&gt; - : 'a Stream.t = <abstr&gt;
>
> with tuareg, gives
>;
> loc>ocaml stream.ml
> File "stream.ml", line 6, characters 0-2:
> Syntax error
>;
> when using ocaml.
&gt;
> thanks for helping.
>
> François Colonna
&gt;
>

This is the same thing. Your file must be pre-processed.
I do not have the right incantation, but you will find it in Martin
Jambon's nice tutorial:

http://martin.jambon.free.fr/extend-ocaml-syntax.html

Salutations

Matt

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] stream syntax again
user name
2006-11-24 12:21:46

Matthieu Dubuget wrote:
&gt; Francois Colonna a écrit :
>
>> Hello
>;>
>> adding #load "camlp4o.cma&quot;;;
>> helps in the socalled toplevel mode not in "batch" mode.
>;> the file stream.ml
>>
>> loc>cat stream.ml
>> (**
>&gt; * stream problem
&gt;> *)
>&gt; #load "camlp4o.cma&quot;;;
>> [< >];;
&gt;>
&gt;>
>;> which gives
>;> # [< >];;
&gt;> - : 'a Stream.t = <abstr&gt;
>&gt;
>>; with tuareg, gives
>;>
>> loc>ocaml stream.ml
>> File "stream.ml", line 6, characters 0-2:
>> Syntax error
>;>
>> when using ocaml.
&gt;>
>;> thanks for helping.
>>
&gt;> François Colonna
&gt;>
&gt;>
>>
>
&gt; This is the same thing. Your file must be pre-processed.
> I do not have the right incantation, but you will find it in Martin
&gt; Jambon's nice tutorial:
>
> http://martin.jambon.free.fr/extend-ocaml-syntax.html
>
> Salutations
>
&gt; Matt
>
>
>;
Thanks for the reference.
I do not understand why should I preprocess the *.ml file to use streams.
Streams are part of the language, aren't they ?

Best
François

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] stream syntax again
user name
2006-11-24 12:51:20

On Fri, Nov 24, 2006 at 01:21:46PM +0100, Francois Colonna wrote:
&gt; Thanks for the reference.
> I do not understand why should I preprocess the *.ml file to use streams.
> Streams are part of the language, aren't they ?

No, they're _not_ part of the base language at all. OCaml allows you
to define syntax extensions to the language using a meta-language
called camlp4, and streams are one such camlp4 extension.

Rich.

--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Internet Marketing and AdWords courses - http://merjis.com/courses - NEW!
Merjis blog - http://blog.merjis.com - NEW!

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] stream syntax again
user name
2006-11-24 13:22:42

On Fri, Nov 24, 2006 at 12:51:20PM +0000, Richard Jones wrote:
&gt; On Fri, Nov 24, 2006 at 01:21:46PM +0100, Francois Colonna wrote:
&gt; > Thanks for the reference.
> > I do not understand why should I preprocess the *.ml file to use streams.
> > Streams are part of the language, aren't they ?
>
> No, they're _not_ part of the base language at all. OCaml allows you
> to define syntax extensions to the language using a meta-language
> called camlp4, and streams are one such camlp4 extension.

That seems like an ironic choice of term, considering the ml at the end
of the language name OCaml stands for "meta-language&quot;. Feel free to
ignore this minor digression, of course. . . .

--
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
"There comes a time in the history of any project when it becomes necessary
to shoot the engineers and begin production." - MacUser, November 1990

__._,_.___
.

__,_._,___
[1-10] [11-14]

about | contact  Other archives ( Real Estate discussion Medical topics )