caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] No patterns of type vect
@ 2003-05-04 16:07 WatchDog
  2003-05-04 16:25 ` David Brown
  0 siblings, 1 reply; 2+ messages in thread
From: WatchDog @ 2003-05-04 16:07 UTC (permalink / raw)
  To: caml-list

Hello !
I'm using CamlLight 0.74, and I've just noticed it is not possible to 
use a pattern-matching with patterns of type vect.
For instance, the dummy function below is not valid :

let head = function
[||] -> failwith "no_head"
| t -> t.(0) ;;

OK, I acknowledge that lists would be more suitable for such a function, 
but why is it forbidden to match on vectors (or arrays, for the 
Objective Camlists) ?
Thanks.

JB, Paris.

-------------------
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


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

* Re: [Caml-list] No patterns of type vect
  2003-05-04 16:07 [Caml-list] No patterns of type vect WatchDog
@ 2003-05-04 16:25 ` David Brown
  0 siblings, 0 replies; 2+ messages in thread
From: David Brown @ 2003-05-04 16:25 UTC (permalink / raw)
  To: WatchDog; +Cc: caml-list

On Sun, May 04, 2003 at 06:07:25PM +0200, WatchDog wrote:
> Hello !
> I'm using CamlLight 0.74, and I've just noticed it is not possible to 
> use a pattern-matching with patterns of type vect.
> For instance, the dummy function below is not valid :
> 
> let head = function
> [||] -> failwith "no_head"
> | t -> t.(0) ;;
> 
> OK, I acknowledge that lists would be more suitable for such a function, 
> but why is it forbidden to match on vectors (or arrays, for the 
> Objective Camlists) ?

It works in objective caml, so I suspect it just hadn't been done yet in
CamlLight.

Dave

-------------------
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


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

end of thread, other threads:[~2003-05-04 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-04 16:07 [Caml-list] No patterns of type vect WatchDog
2003-05-04 16:25 ` David Brown

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).