APLX Help : Help on APL language : System Methods : ⎕DS Display summary of object
|
|
![]() |
|
Implemented for Internal, External and System classes. Syntax:
For Internal classes, A←⎕NEW Contact A.Name←'Alphonse T. Randall' A.Address←'The Manor House,Main Square,Moreton-under-Stockwood,Tenby' A.EMail←'Alphonse.Randall@themanor.com' A.Recnum←34973 A.⎕DS Name='Alphonse T. Randall', Address='The Manor House,Main Square,Moreton-under-S tockwoo...', EMail='Alphonse.Randall@themanor.com', Recnum=34973 For System classes, For External classes, In this example, we create (in each of three architectures) an object representing the same date/time, and use 'ruby' ⎕SETUP 'require' 'Date' RubyDate←'ruby' ⎕NEW 'DateTime' 2004 12 13 8 34 03 RubyDate.⎕DS 2004-12-13T08:34:03+00:00 NetDate←'.net' ⎕NEW 'DateTime' 2004 12 13 8 34 03 NetDate.⎕DS 13/12/2004 08:34:03 JavaDate←'java' ⎕NEW 'java.util.Date' 2004 12 13 8 34 03 JavaDate.⎕DS Fri Jan 13 08:34:03 GMT 3905 MixedObjects←RubyDate,NetDate,JavaDate MixedObjects [ruby:DateTime] [.net:DateTime] [java:Date] MixedObjects.⎕DS 2004-12-13T08:34:03+00:00 13/12/2004 08:34:03 Fri Jan 13 08:34:03 GMT 3905 ⎕DISPLAY MixedObjects.⎕DS ┌→─────────────────────────────────────────────────────────────────────────────────┐ │ ┌→────────────────────────┐ ┌→──────────────────┐ ┌→───────────────────────────┐ │ │ │2004-12-13T08:34:03+00:00│ │13/12/2004 08:34:03│ │Fri Jan 13 08:34:03 GMT 3905│ │ │ └─────────────────────────┘ └───────────────────┘ └────────────────────────────┘ │ └∊─────────────────────────────────────────────────────────────────────────────────┘ The actual string which is displayed depends on the individual class. The style of the display may not always be consistent for a given architecture. For example, in the .Net framework, the ToString method sometimes displays the data associated with the class (as in the DateTime example above), sometimes just the object's class name, and sometimes a verbose summary of an object's properties: PT←'.net' ⎕NEW 'System.Drawing.Point' PT.⎕DS {X=0,Y=0} FD←'.net' ⎕NEW 'System.Windows.Forms.FontDialog' FD.⎕DS System.Windows.Forms.FontDialog, Font: [Font: Name=Microsoft Sans Serif, Size=8 .25, Units=3, GdiCharSet=0, GdiVerticalFont=False] HT←'.net' ⎕NEW 'System.Collections.Hashtable' HT.⎕DS System.Collections.Hashtable In this example, in R, we create an array of complex numbers and use m←'r' ⎕new 'complex' (3 2⍴(1 2) (3 4) (5 6) (7 8) (9 10) (11 12)) m [r:matrix] m.⎕ds 1+ 2i 3+ 4i 5+ 6i 7+ 8i 9+10i 11+12i |
|
APLX Help : Help on APL language : System Methods : ⎕DS Display summary of object
|
Copyright © 1996-2010 MicroAPL Ltd