otp R6.0B0

Geoff Wong geoff@REDACTED
Tue Nov 30 06:12:22 CET 1999


Hi,

It seems some semantics have changed in the new open
source release (apparently in the release notes; but too
obscure for me to find and understand). I'm having problems 
with the following function (it causes runtime errors):

not_started_servers(Ss) ->
  db:eval(query
       [T ||
         T <- table(template),
         not S <- Ss,
         C=S.cluster,
         T.cluster=C#cluster.name,
         OriginT=S#server.template,
         T.node=OriginT#template.node]
     end).

It worked fine under the previous release.

Anyway, I tried the following (as suggested by Hakan Mattsson at CSlab):

    not_started_servers(Ss) ->
      db:eval(query
        [T ||
          T <- table(template),
          not lists:member(S, Ss),
          C=3DS.cluster,
          T.cluster=3DC#cluster.name,
          OriginT=3DS#server.template,
          T.node=3DOriginT#template.node]
      end).

This doesn't even compile.

So I tried the following:

not_started_servers(Ss) ->
    F=fun(X,Y)-> case lists:member(X,Y) of
                      true -> false; false -> true end end,
    db:eval(query
            [T ||
              T <- table(template),
              F(S, Ss),
              C=S.cluster,
              T.cluster=C#cluster.name,
              OriginT=S#server.template,
              T.node=OriginT#template.node]
    end).

This also results in a runtime crash too (but I might've
got the fun wrong).

Anyway - does anyone have any better suggestions?

Geoff





More information about the erlang-questions mailing list