Skip to content

Instantly share code, notes, and snippets.

View allenwb's full-sized avatar

Allen Wirfs-Brock allenwb

View GitHub Profile
@allenwb
allenwb / short-functions.js
Created March 11, 2012 08:13 — forked from dherman/short-functions.js
using do () {} for concise functions
// 1. No new syntax for non-TCP functions.
//
// This approach does do include a shorter syntax for regular functions, so if a classic JS function
// is what you want you use the classic long form function expression:
a.some(function (x){
if (invalid(x))
return true;
console.log(x);
});
@allenwb
allenwb / minimalist-classes.js
Created November 2, 2011 03:04 — forked from BrendanEich/minimalist-classes.js
less minimalism, richer leather
//work in progress
// A response to jashkenas's fine proposal for minimalist JavaScript classes.
// and BrendanEich's Rich Corinthian Leather alternative proposal
//intro and justifications still to come
// Harmony always stipulated classes as sugar, so indeed we are keeping current
// JavaScript prototype semantics, and classes would only add a syntactic form
// that can desugar to ES5. This is mostly the same assumption that Jeremy