gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gm2] is IN not implemented yet?


From: Gaius Mulley
Subject: Re: [Gm2] is IN not implemented yet?
Date: Fri, 06 Nov 2009 17:10:44 +0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Martin Kalbfuß <address@hidden> writes:

> TYPE InitSet = SET OF [0..6];
>
> PROCEDURE Init(flags : InitSet);
> VAR Result : INTEGER;
>     Index  : CARDINAL;
> BEGIN
>      FOR Index := 0 TO 6 DO
>         IF Index IN flags THEN
>              Result := SDL_InitSubSystem(FlagValues[Index]);
>              IF Result = -1 THEN
>                   EXCEPTIONS.RAISE(ExSrc, 1, "Couldn't initialize SDL");
>              END;
>         END;
>      END;
> END Init;
>
> Hi again,
>
> I try to check if the InitSet has a flag set with IN. He tells me 
>
> SDL4M.mod:32:6: error: syntax error, found `IN'
>
> Isn't it implemented, or do I make a mistake?
>
> Thanks

Hi Martin,

yes IN is implemented:

MODULE testin ;

TYPE InitSet = SET OF [0..6];

PROCEDURE Init(flags : InitSet);
VAR Result : INTEGER;
    Index  : CARDINAL;
BEGIN
     FOR Index := 0 TO 6 DO
          IF Index IN flags THEN
(*
               Result := SDL_InitSubSystem(FlagValues[Index]);
               IF Result = -1 THEN
                    EXCEPTIONS.RAISE(ExSrc, 1, "Couldn't initialize
                    SDL");
               END;
*)
          END;
     END;
END Init;

BEGIN
   Init(InitSet{})
END testin.

compiles fine..  (indeed IN and sets in general are heavily used
during the parser within gm2)

regards,
Gaius




reply via email to

[Prev in Thread] Current Thread [Next in Thread]