Cool (程式語言)
外表
| 編程範式 | 物件導向 |
|---|---|
| 設計者 | 亞歷山大亞堅 |
| 編程員 | 亞歷山大亞堅 |
| 第一次出現 | 1996 |
| 類型系統 | 靜態、強類型、顯現 |
| 衍生變體 | |
| Cool 2004、Cool 2005、Cool 2006、Cool 2007、Cool 2008、unCool | |
| 啟發語言 | |
| Java、ML、Pascal、Sather | |
Cool(英文:Classroom Object Oriented Language嘅縮寫)係1996年由亞歷山大亞堅(Alexander Aiken)喺參考咗 Java/ML/Pascal/C++ 等咁多款程式編制語言之後發明出嚟嘅新型程式語言;主要用響學院嘅教學之上。
例子
[編輯]class Main : IO is
Main() begin
out_string("Enter an integer greater-than or equal-to 0: ");
let input: Integer := in_int(); in
if input < 0 then
out_string("ERROR: Number must be greater-than or equal-to 0\n")
else
out_string("The factorial of ").out_int(input);
out_string(" is ").out_int(factorial(input))
fi
end
end;
factorial(num: Integer): Integer := if num = 0 then 1 else num + factorial(num - 1) fi;
end;
參考
[編輯]出面網頁
[編輯]- Cool: The Classroom Object-Oriented Language project main page