LoginSignup
0
0

JuliaのOOP事情の備忘録

Posted at
  • Juliaは本来的にobject-orientedではない(資料1)
  • object-orientedなコーディングをしたいときに使えるJulia特有のツール・概念がある
  • Juliaはmultiple dispatch(wikipedia)というパラダイムに属する言語である(資料1,資料2)
  • mutable struct という構文を使うと、一般的なOOP言語のクラスや構造体と似たような振る舞いを出来る。中に定義されるものは全てdataであり、関数も登録できるが、メソッドという概念は無いらしい。
  • 単に連想配列を使いたいだけなら、「名前付きタプル」を使えばx = (name="Tom",age=21,job="engineer"); x.name #->Tomのように出来る。
  • 典型的なOOP言語と似たような書き方をする方法もあるにはあり、色々な人が個別に研究している(資料3, 資料4)
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0