List comprehensions in queries.

Bijan Parsia bparsia@REDACTED
Thu Feb 25 01:45:14 CET 1999


Are there additional restrictions on list comprehensions in queries?


I have the following query:

   		PathLength = length(Path) + Depth,
       	F = fun() ->
            Q = query [Item || Item <- table(cvn_path_item),
                            lists:prefix(Path, Item.path),
                            length(Item.path) =< PathLength]
                                     end,
                mnemosyne:eval(Q)
            end,

Where #cvn_path_item.path is a list.

If I try this I get:

	{aborted,{badarg,{ets,lookup,
                      [db_get,[mnemosyne_catalog,{image,cvn_path_item}]]}}}

But if I do the query, and then do the rest of the list comprehension on
the result, it works fine.

Help?

Cheers,
Bijan Parsia.





More information about the erlang-questions mailing list