caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ocaml stream question
@ 2001-12-10 18:44 Garry Hodgson
  2001-12-10 18:53 ` Daniel de Rauglaudre
  0 siblings, 1 reply; 2+ messages in thread
From: Garry Hodgson @ 2001-12-10 18:44 UTC (permalink / raw)
  To: caml-list

i'm playing with ocaml streams to build a lexer, using ocaml 3.02.  
trying the sample code:

     let next = function [< 'x >] -> x ;;

gets me:

     Characters 20-22:
     Syntax error

do i need to do something special to enable streams?
if i just do:

     let foo = [<>];;

it works ok, giving me:

     val foo : 'a Stream.t = <abstr> 

it appears to be the pattern match it doesn't like.

any clues for the clueless?


-- 
Garry Hodgson                   Let my inspiration flow
Senior Hacker                      in token rhyme suggesting rhythm
Software Innovation Services    that will not forsake me
AT&T Labs                          'til my tale is told and done.
garry@sage.att.com
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] ocaml stream question
  2001-12-10 18:44 [Caml-list] ocaml stream question Garry Hodgson
@ 2001-12-10 18:53 ` Daniel de Rauglaudre
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel de Rauglaudre @ 2001-12-10 18:53 UTC (permalink / raw)
  To: caml-list

Hi,

On Mon, Dec 10, 2001 at 01:44:01PM -0500, Garry Hodgson wrote:

> i'm playing with ocaml streams to build a lexer, using ocaml 3.02.  
> trying the sample code:
>      let next = function [< 'x >] -> x ;;

In OCaml, unlike Caml Light, you must use the keyword "parser":
       let next = parser [< 'x >] -> x ;;

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-12-10 18:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-10 18:44 [Caml-list] ocaml stream question Garry Hodgson
2001-12-10 18:53 ` Daniel de Rauglaudre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).