Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Pattern matching and strings
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Remi VANICAT <vanicat@l...>
Subject: Re: [Caml-list] Pattern matching and strings (and a mini-bug in Scanf)
Alessandro Baretta <alex@baretta.com> writes:

> Pierre Weis wrote:
>> [...]
>
>> I should say that I am reluctant to had a special typing rule for the
>> new specifier you proposed, when "%[\000-\255]" does perfectly the job
>> and does not require any addition to the type-checker nor to the
>> implementation of Scanf.
>> Pierre Weis
>
> Why do you mention the type checker? Is each conversion specifier a
> special case for the type checker?

Of course it is :

# Scanf.scanf "%s %d %i";;
- : (string -> int -> int -> '_a) -> '_a = <fun>

to type this, the type checker have to look inside the format and find
that %s look for a string, %d and %i an int.

-- 
Rémi Vanicat
vanicat@labri.u-bordeaux.fr
http://dept-info.labri.u-bordeaux.fr/~vanicat
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners