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

Re: [MacPerl] MacPerl & Frontier



At 7:13 PM +0200 7/12/96, Matthias Ulrich Neeracher wrote:
>That's indeed a good question. AppleEvent Object Descriptor syntax would be
>a good candidate for a perl library. However, I haven't yet come up with
>a representation that is:
>
> - Extensible
> - Name space clean
> - Fast
...
>$fm = new Mac::AppleEvents::FileMaker;
>
>$fm->open("my:database:file");
>$fm->close(
>    $fm->object("Window", 1),
>    'saving', 'no');
>
>The translation of event names into Perl is fairly natural, but it's not
>so clear with the parameters and AppleEvent objects.
>
>Suggestions?
>Matthias

I was thinking more along the lines of:

$fm->object( { 'class'=> 'Column',
               'form' => 'name',
               'seld' => 'Column1',
               'from' => $fm->object( {'class'=> 'Database',
                                       'form' => 'name',
                                       'seld' => 'db1' } )
            );

This translates pretty straight forward into the equivalent descriptor
string.  However, it's a bit counter intuitive in term of the class
hiearchy.  One would expect a column of a database to be specified as
$fm->database->column instead.  So as a next cut:

$fm->object( {'class'=> 'Database',
              'form' => 'name',
              'seld' => 'db1' } )->object( { 'class'=> 'Column',
                                             'form' => 'name',
                                              seld' => 'Column1' });

I must admit that I haven't quite thought out what to do with the
parameters.  Then again, at this point, the most immediate road block I
have is the syntax of the descriptor strings.  For example, I found this in
a documentation that came with the Alpha distribution:

Descriptor String

obj{ want:type('line'),
     from: obj{ want: type('line'), from: @, form: 'test',
                seld: logi{
                           term: [comp{ relo:=, obj1:"April",
                                        obj2:obj{ want:type('word'),
                                                  from:exmn(),
                                                  form:indx, seld:1 }
                                      },
                                  comp{ relo:=, obj1:"is",
                                        obj2:obj{ want:type('word'),
                                                  from:exmn(),
                                                  form:indx, seld:2 }
                                      }
                                 ],
                           logc:AND
                         }
              },
     form: 'indx',
     seld: 1
}

I need to construct a similar string for FMP3.  Perhaps some one can shed
some light on the subject, and point me to the right direction?  BTW, I
hope I didn't open a whole can of worm for you, *sheepish grin*.

Pete

Peter Chen, Hochem BV, Driebergseweg 17, 3708 JA  Zeist, The Netherlands
tel: +31 (0)30 69-31352  fax: +31 (0)30 69-24881
email: <mailto:Peter.Chen@hochem.nl>,<mailto:petechen@math.rutgers.edu>
URL: <http://www.vin.nl/hochem>