Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] pxp question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques GARRIGUE <garrigue@k...>
Subject: Re: [Caml-list] pxp question
From: Paul Argentoff <argentoff@rtelekom.ru>

> I'm a novice in pxp, so here is one of my firs problems: when I compile this:
> ...
> let collector = find ~deeply:true (fun node -> node # id_attribute_value = 
> colr_name) collectors
> ...
> I get:
> 
> This expression has type
>   ('a Pxp_document.node #Pxp_document.extension as 'a) Pxp_document.node ->
>   'a Pxp_document.node
> but is here used with type
>   ('b Pxp_document.node #Pxp_document.extension as 'b) Pxp_document.node =
    [...]

I am no expert in PXP, but this error message simply tells you that
you are passing a function where a node is expected (unfortunately you
didn't show the position highlighted by the error).
Looking at the type of find in the PXP manual, it looks like your
"collectors" is a function.
This kind of thing can happen when using let...in and forgetting an
argument; it gets a bit of habit to see what can cause an error.

Jacques Garrigue

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