/[papo]/gnue/appserver/doc/geasarch/outline.txt
ViewVC logotype

Diff of /gnue/appserver/doc/geasarch/outline.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by charlie, Tue Aug 27 18:15:51 2002 UTC revision 1.4 by styxman, Fri Nov 8 16:28:59 2002 UTC
# Line 341  ODMG Python Binding (needs paraphrasing Line 341  ODMG Python Binding (needs paraphrasing
341                 s=segment(-3,7)                 s=segment(-3,7)
342                 print s.left_limit, s.right_limit                 print s.left_limit, s.right_limit
343    
344               Unions
345                 - Union types are mapped to classes with two attributes,
346                 first being the descriminant _d, the second the associated
347                 value _v
348                 - for each branch, there is an additional attribute,
349                 which can only be accessed if the branch has been set,
350                 there are three possibilities:
351    
352                   - if the discriminant was explicitly listed in a case
353                     statement, the value is of the branch associated
354                     with the case
355                   - if the discriminant is not explicitly listed and
356                     there is a default case label, the value is of the
357                     branch associated with the case label
358                   - if the discriminant is not listed, and there is no
359                     default, the value is None
360    
361                 - constructor of the class expects the discriminator and
362                 the value as arguments
363                 - alternatively, the union can also be constructed by
364                 passing a keyword argument, with the field name of the
365                 union as the key, if more than one discriminator is
366                 associated with a field, the discriminator must be
367                 set explicitly
368    
369                 Example:
370    
371                 union MyUnion switch(long)
372                 {
373                   case 1: string s;
374                   default: long x;
375                 };
376    
377                 can be accessed as
378    
379                 u = MyUnion(17, 42)
380                 print u.x
381                 u = MyUnion(s = 'string')
382                 print u._d, u._v
383    
384        Exceptions        Exceptions
385          - when error detected, exception is raised using standard Python          - when error detected, exception is raised using standard Python
386          exception mechanism, which consists of deriving from          exception mechanism, which consists of deriving from
# Line 686  ODMG Python Binding (needs paraphrasing Line 726  ODMG Python Binding (needs paraphrasing
726          - ch. 2 introduced several new kinds of collections that          - ch. 2 introduced several new kinds of collections that
727          extend the IDL sequence          extend the IDL sequence
728          - the following shows the Python interfaces/classes that this          - the following shows the Python interfaces/classes that this
         binding defines for each of the collection interfaces  
729            binding defines for each of the collection interfaces

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26