Quantcast

Error "mnemosyne query, missing transformation"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error "mnemosyne query, missing transformation"

Chris Pressey
I've run across an error compiling Mnemosyne queries that I don't
understand.

My code looks like this:

  ...
  -record(product,
  {
    id          = 0,
    name        = "",
    description = "",
    ...
  }).
  ...
  mnesia:create_schema([node()]),
  mnesia:start(),
  mnesia:create_table(product,
    [{attributes, record_info(fields, product)}]),
  ...
  F = fun() ->
        mnemosyne:eval(query [P.name ||
                               P <- table(product),
                               P.name = ProductName        
                             ] end)
      end,
  {atomic, T} = mnesia:transaction(F),
  ...

When trying to compile this I get the rather unhelpful error message
"mnemosyne query, missing transformation" (on the line containing the
keyword 'query') for which I can find no more detailed description.
(Which surprises me a bit, because this is essentially the example query
given in the Mnesia documentation.)

I'm using the otp_win32_R7B-0.exe release.  This can't possibly be a
bug, but I can't think of what I've overlooked in phrasing this query.

Thanks in advance...

_chris

--
Change rules.
Share and Enjoy on Cat's Eye Technologies' Electronic Mailing List
http://www.catseye.mb.ca/list.html


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error "mnemosyne query, missing transformation"

Håkan Mattsson-6
On Fri, 9 Feb 2001, Chris Pressey wrote:

Chris> When trying to compile this I get the rather unhelpful error message
Chris> "mnemosyne query, missing transformation" (on the line containing the
Chris> keyword 'query') for which I can find no more detailed description.
Chris> (Which surprises me a bit, because this is essentially the example query
Chris> given in the Mnesia documentation.)

Mnemosyne uses parse transforms to extend the Erlang syntax with
queries.  In order to tell the compiler that it should filter its
internal form through Mnemosyne's parse transform function, you need
to add the following line in the beginning of your module:

-include_lib("mnemosyne/include/mnemosyne.hrl").

/H?kan

---
H?kan Mattsson
Ericsson
Computer Science Laboratory
http://www.ericsson.se/cslab/~hakan



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error "mnemosyne query, missing transformation"

Chris Pressey
Hakan Mattsson wrote:
> On Fri, 9 Feb 2001, Chris Pressey wrote:
> Chris> When trying to compile this I get the rather unhelpful error message
> Chris> "mnemosyne query, missing transformation" [...]
> -include_lib("mnemosyne/include/mnemosyne.hrl").

Thank you.  This might be a good thing to point out in the FAQ and/or
section 2.2 of the Mnesia User's Guide.

_chris

--
Change rules.
Share and Enjoy on Cat's Eye Technologies' Electronic Mailing List
http://www.catseye.mb.ca/list.html


Loading...