Skip to content

Instantly share code, notes, and snippets.

View MostAwesomeDude's full-sized avatar

Corbin Simpson MostAwesomeDude

View GitHub Profile

Consider one single vat. There are objects in this vat. With the exception of some types, listed below, all objects are made of pure S code. The difference between a builtin type and an object made from S code is not visible from within the object space; for all objects, only message passing can be used to communicate and no object introspection is possible.

Note that "type" simply means "a template for an object." There is no visible difference between a function which returns an object and a type, nor is there any typechecking per se.

Here are some builtin types. This list is not yet exhaustive, but it won't get much longer. Types without literal syntax have a + next to them, and have quasiliteral syntax instead.

  • int
  • float
  • str: Unicode strings.
  • bytes+: Bytestrings. bytes is important because it is the type of objects which are used as identifiers and message names.
def mk_nested_defaultdict(levels, factory):
base = lambda: defaultdict(factory)
while levels:
levels -= 1
base = lambda: defaultdict(base)
return defaultdict(base)
@MostAwesomeDude
MostAwesomeDude / simplegeo_zips.py
Created November 15, 2011 01:31 — forked from joshsmith/simplegeo_zips.py
Finding zip codes within the radius of a given address using SimpleGeo
from math import pi,sqrt,sin,cos,asin,atan2
from simplegeo import Client
import json
# Instantiate the SimpleGeo Client
client = Client('KEY', 'SECRET')
context = client.context.get_context_by_address("4275 Swift Ave, San Diego, CA")
lat1 = float(context['query']['latitude'])
lon1 = float(context['query']['longitude'])
#!/usr/bin/env python
"""The results from my computer:
Good headers:
List creation and iteration: 4.34622311592
List iteration and substitution: 3.61615085602
LC (spendy): 9.65025401115
Mixed headers:
List creation and iteration: 8.39401197433