摘要: class Map constructor : -> @entry = {} @count = 0 size : -> return @count isEmpty : -> return @count == 0 containsKey : (key) -> if @isEmpty() return false return @entry.hasOwnProperty key containsValue : (val)-> ... 阅读全文
posted @ 2013-12-31 23:46 水之原 阅读(1309) 评论(0) 推荐(0) 编辑
摘要: CoffeeScript is a little language that compiles into JavaScript.Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.The golden rule of CoffeeScript is:"It's just JavaScript&q 阅读全文
posted @ 2013-12-31 23:30 水之原 阅读(1011) 评论(0) 推荐(0) 编辑
摘要: #include #include //接口#ifndef Interface#define Interface struct#endif//类#ifndef Class#define Class struct#endif//抽象形状类Class Shape;typedef Class Shape shape;//抽象形状类的方法声明shape* Shape(int edges);int shape_getEdges(shape *);int shape_getArea(void);void _Shape(shape *);//三角形类Class Triangle;typedef Class 阅读全文
posted @ 2013-12-31 23:14 水之原 阅读(630) 评论(0) 推荐(2) 编辑
摘要: I’ve been doing a lot of work, lately, with JavaScript inheritance – namely for mywork-in-progress JavaScript book– and in doing so have examined a number of different JavaScript classical-inheritance-simulating techniques. Out of all the ones that I’ve looked at I think my favorites were the implem 阅读全文
posted @ 2013-12-31 21:58 水之原 阅读(1041) 评论(0) 推荐(0) 编辑