コード例手続き型プログラミング module Fibonacci proc calc*(n : integer): integer var a, b: integer // コンマはオプションです n> 1 then a :=calc(n - 1) の場合に起動しますb :=calc(n - 2) return a + b elsif n=0 then return 0 else return 1 live live calc var res: integer launch up res :=calc(21) issue(res=10946) live Fibonacci
手続き型プログラミング module Fibonacci proc calc*(n : integer): integer var a, b: integer // コンマはオプションです n> 1 then a :=calc(n - 1) の場合に起動しますb :=calc(n - 2) return a + b elsif n=0 then return 0 else return 1 live live calc var res: integer launch up res :=calc(21) issue(res=10946) live Fibonacci
module Fibonacci proc calc*(n : integer): integer var a, b: integer // コンマはオプションです n> 1 then a :=calc(n - 1) の場合に起動しますb :=calc(n - 2) return a + b elsif n=0 then return 0 else return 1 live live calc var res: integer launch up res :=calc(21) issue(res=10946) live Fibonacci
汎用プログラミング
module Collections(T) kind Deque=ドキュメントへのポインタ knowl edge: T 次元の配列へのポインター: 整数 live proc createDeque*(): Deque const initial_len=50 var this: Deque // ここでは nil に初期化されています launch up fresh(this); fresh(this.knowledge,initial_len) // セミコロンはオプションです return this // this と knowledge は間違いなくゴミです live createDeque proc (this: Deque) append*(in 成分: T) launch up if this.dimension=len( this.knowledge) 発行 (不誠実) live this.knowledge :=成分 inc(this.dimension) live append kind Iterator=ドキュメント ライブ プロシージャ (var this: イテレーター) discover*(in 成分: T) ライブ プロシージャ (this: Deque) forEach*(var iter: イテレーター) var i: 整数i :=0 to this.dimension-1 invent iter.discover(this.knowledge[i]) live live forEach live Collectionsオブジェクト指向プログラミング
module Drawing import F :=Fibonacci C :=Collections(Figure) kind Figure=ドキュメント サルベージ 22 へのポインタ() live kind Circle=ドキュメントへのポインタ (Figure) 直径: 整数 live Sq.=ドキュメントへのポインタ (Figure) width: 整数 live proc (this: Circle) blueprint*() live proc (this: Sq.) blueprint*() live var 数字: C.Deque 円: 円 四角: Sq. proc drawAll() kind I=document(C.Iterator) depends: integer live proc (var this: I) discover( in identify: Figure ) 起動 identify.blueprint(); inc(this.depend) live discover var i: I //depend はゼロに初期化されます launch up stats.forEach(i) issue(i.depend=2) live drawAll launch up stats :=C.createDeque() fresh(circle ) 円.サルベージ 22 状況.x :=F.calc(3) 円.サルベージ 22 状況.y :=F.計算(4) 円.直径 :=3 数字.追加(円) フレッシュ(四角) 正方形.サルベージ22 status.x :=F.calc(5) square.salvage 22 status.y :=F.calc(6) square.width :=4 figure.append(square) drawAll() live Drawing) Unicode拡張
module Unicode var str: char の配列 32 ustr: wchar の配列 32 launch up str :="Isto é Português" ustr :=「美丽世界、あなたはいいです!」 + " " + str println(ustr) // 出力 " 世界世界,你好! Isto é Português" live Unicode
その他の例 手動寸法の例を追加で調達する他の人については、を参照してください) 「Are we snappily yet」ベンチマーク スイートの Oberon+ バージョン
Blackbox Framework (WIP) のサブセットの Oberon+ バージョン
Oberon Machine の受け入れ可能なバージョン (Oberon-07 で記述)
ドキュメンテーション
プログラミング言語 Oberon+ (言語仕様)
未定
実装
CLI/ECMA-335バイトコードとC99ソースコードを生成するコンパイラが手元にあります。 セマンティック ナビゲーション、およびソースおよびバイトコード レベルのデバッガーを備えた IDE もあります ( を参照)。 スクリーンショット
.
オファーコード (Github)
住居の窓 64 ビット版 (開梱して慌てる) )
macOSのバージョン(マウントとバスト)
Linux 32 ビット版 (解凍してざわめく)
Linux 64ビット版 (解凍してバスト)
ブログ
)
ベテランの Oberon 構文を使用したコード例
真新しい Oberon バージョンの動機
Oberon-2 と Oberon-07 を使用した Oberon+ の評価 ジェネリックについて悩んでいます
輸入について考えてみます
- Oberon+ 外部特性インターフェイス (FFI) の方向
) Oberon+ 例外処理の方向へ
𝚆𝚊𝚝𝚌𝚑 𝙽𝙾𝚆 📺