摘要:
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)-> ... 阅读全文
摘要:
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 阅读全文
摘要:
#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 阅读全文
摘要:
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 阅读全文