next up previous
Next: プログラミング例題 Up: ソフトウェア第三 講義資料 クロージャ,スコープ,遅延評価,オブジェクト,立体モデル Previous: 14.5 Sendの実現

15 Euslispのオブジェクト指向

Euslispは,ロボットのプログラミングシステムを記述するために工業技術院 電子技術総合研究所(現産業技術総合研究所)の松井俊浩氏により1987年ころか ら開発され現在も独自の改良が加えられている言語である.ロボットという通 常は計算機の応用側にいる人が自分の研究に必要だということで自分が使える 言語が作られた. Euslisp はオブジェクト指向機能の上でリスト処理などを実現しているLisp言 語である.Lispの上にオブジェクト指向機能を実現するのではなく,オブジェ クト指向機能の上でLispの基本データであるconsなども実現している. たとえばconsセルもクラスになっているため,リストのコンスにもメソッ ドを定義することが可能.このようにLispの組み込みデータオブジェクト もクラスとして取り扱える機能があると,ファイルなどのストリームの下位ク ラスにネットワーク通信用(たとえばソケット通信など)のストリームを拡張 して定義することができ,一般のストリームと同じメソッドを使えるようになる. 前節で示したクラスシステムのdefclass, defmethod, instance, send はEuslispで実装されている形式である. Euslispのマニュアルは,
eus/doc/jlatex/jmanual.pdf
にある. Xウィンドウ用の表示を前提とするeuslispは,eusxというプログラム名で あり,OpenGL用の表示を前提とするeuslispは,eusglというプログラム名で ある.グラフィック表示を行わないeuslispは,eusというプログラム名である. オブジェクト指向クラスの全体を表示する関数として,(class-hierarchy)が あり,それを実行すると下のような出力が得られる.

object 
   cons 
      queue 
   propertied-object 
      symbol 
         foreign-pod 
      package 
      stream 
         file-stream 
         broadcast-stream 
         textwindowstream 
      io-stream 
         socket-stream 
      metaclass 
         vectorclass 
            cstructclass 
      readtable 
      array 
         image-2d 
            single-channel-image 
               bitmap-image 
               grayscale-image 
               index-color-image 
            multi-channel-image 
               split-color-image 
               color-image 
                  color-image16 
                  color-image24 
                  color-image32 
      thread 
      port-selector 
      coordinates 
         cascaded-coords 
            faceset 
               body 
            sphere 
            viewing 
               projection 
                  viewing2d 
                  parallel-viewing 
                  perspective-viewing 
            coordinates-axes 
            polygon2d 
            circle2d 
         viewport 
      barrier-synch 
      synch-memory-port 
      line 
         edge 
            winged-edge 
      plane 
         polygon 
            face 
            hole 
         semi-space 
      viewer 
      viewsurface 
         tektro-viewsurface 
         xobject 
            gcontext 
            xdrawable 
               xpixmap 
               xwindow 
                  panel 
                     menu-panel 
                     menubar-panel 
                     pixmap-scroller 
                     eustop-win 
                     filedialog 
                        filepanel 
                     textviewpanel 
                     confirmpanel 
                     colorpickerpanel 
                     objectbrowser 
                  canvas 
                     graph-canvas 
                  panel-item 
                     button-item 
                        menu-button-item 
                        bitmap-button-item 
                     text-item 
                     slider-item 
                     choice-item 
                     joystick-item 
                  xscroll-bar 
                     xhorizontal-scroll-bar 
                  characterwindow 
                     textwindow 
                        buffertextwindow 
                           scrolltextwindow 
                        textedit 
                        eustop-history-window 
      dda 
         line-dda 
         ellipse-dda 
            circle-dda 
      colormap 
   compiled-code 
      foreign-code 
      closure 
      load-module 
   label-reference 
   vector 
      float-vector 
      integer-vector 
      string 
         socket-address 
         cstruct 
            carray 
               c-long 
               c-int 
            gcvalues 
            xcolor 
            setwindowattributes 
            windowattributes 
            xevent 
      bit-vector 
      foreign-string 
   extended-number 
      ratio 
      complex 
      bignum 
   socket-port 
   pathname 
      url-pathname 
   hash-table 
   translator 
   identifier 
   identifier-table 
   stack-frame 
   compiler 
   bounding-box 
   constrained-point 
   constraint-relation 
   edge-image 
   face-image 
   stereo-viewing 
   help-item 
nil


generated through LaTeX2HTML. M.Inaba 平成18年5月7日