Cool（程序编制个言话）

Cool———是英文个缩写词：Classroom Object Oriented Langage<P>该是1996年由大仲马•艾肯（Alexander Aiken）受到Java／ML／Pascal／C++搿星程序编制言话个启发发明出来个新型言话。
<P>
侬要是有辰光也好好比较、比较看是弗是交关酷个。。。

	程序个实例
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;</ul></ul></ul></ul></ul>

参考文献
 Cool: A Portable Project for Teaching Compiler Construction
 CoolAid: The Cool 2008 Reference Manual 
 (Un)CoolAid: The UnCool Reference Manual 

外部链接	
Cool: The Classroom Object-Oriented Language  project main page

分类:程序编制言话
分类:OOP-程序编制言话