[Top Page][All Pages][Recent Changes]

Edit History:View

Content of A+/uim/Emacs/2008/03/22/aplus-mode at 2008/03/22 22:35:30 JST

View diff from current version

Return to the edit history

  APLはキーボード入力と画面出力がアレなのでしばらく不遇だったが、
  UnicodeにAPL文字が入ってからちょっとはましになったかもしれない、と思い、
  APLの方言である[http://www.aplusdev.org/ A+]の学習を開始してみた。
  
  * 文字コードの壁
  
  APL諸言語と同じくA+もASCIIコード領域をAPL文字とみなして評価しているので、
  UnicodeとA+文字を相互に変換してやる必要がある。
  
  ** Emacsから使う
  
  A+をEmacsから使うには[http://stud4.tuwien.ac.at/~e0225855/unicapl/unicapl.html UnicAPL]のapl.elが便利なので、いれておく。
  
  これと、[[sf:openAPL]]付属のapl-mode.elを組み合わせて、
  aplus-modeをでっちあげてみた。
  
  - [[files:aplus-mode.el]]
  
  これをいれて、.emacsに、
  
  {{{
  (setq auto-mode-alist
        (append
         '(("\\.\\+\\'" . aplus-mode))
         auto-mode-alist))
  (autoload 'aplus-mode "aplus-mode" "edit A+ script." t nil)
  }}}
  
  を加えることにより、拡張子''''''.+''''''でaplus-modeで開くようになる。
  あとは、M-x set-input-method apl-asciiでapl.elのAPL入力モードに入れるようになるので、
  プログラミング環境はほぼ完成。まだ対話入力モードがないけど我慢。
  
  ** それ以外での入力
  
  uim-aplも作ってみた。WebページにAPLのコードを貼りたいときには便利。
  
  - [[files:uim-aplus.scm]]
  
  * プログラムを書いてみる
  
  {{{
  ⍝ ここはコメント
  "hello,world."
  sys.exit 0
  }}}
  
  たぶん、A+に関しては次のエントリから意味不明な文字が飛び交います。
  A+にはASCIIで入力するモードもあるのだけど、こっちは使いません。