Skip to content

Instantly share code, notes, and snippets.

package asmt2;
import java.awt.*;
import java.awt.image.*;
import javax.imageio.ImageIO;
import java.io.*;
public class Main {
// define the three drawing modes
private static final int EDGE_DETECTOR = 0;
cafe babe 0000 0033 0084 0a00 2600 3e0a
003f 0040 0700 410a 0003 0042 0a00 4300
4407 0045 0900 4600 4708 0048 0a00 4900
4a0a 0046 004b 0a00 4c00 4d0a 004c 004e
0700 4f0a 004c 0050 0a00 0d00 510a 000d
0052 0a00 5300 540a 000d 0055 0a00 0d00
5606 406f e000 0000 0000 063f 8010 1010
1010 1006 4008 0000 0000 0000 0a00 5300
570a 004c 0058 0a00 0d00 590a 000d 005a
0a00 5300 5b03 00ff 0000 0300 00ff 0008
package asmt2;
import java.awt.Color;
import java.awt.image.*;
import javax.imageio.ImageIO;
import java.io.*;
public class Main {
public static void main(String[] args) {
if (args.length >= 2) {
(ns paint.core
(:use [seesaw core graphics color]
clojure.math.numeric-tower)
(:require [seesaw.mouse :as m]
[seesaw.bind :as b]
[overtone.live :as o]))
(def canvas-width 50)
(def canvas-height 50)
(def cell-width 8)

Data

Values are a set of key-value pairs. Keys are just normal Paws values. Values may also have some invisible data attached to them, accessible only through system-provided routines, e.g. numbers accessible through system-provided routines for arithmetic.

Each value has an associated routine to handle “juxaposition”. Juxaposition is when you put two values next to each other like this: a b. The routine associated with the value on the left is executed with both values as arguments. The default is to look up the value on the right against the key-value pairs of the object on the right.

A prominent example of different functionality can be seen in routines themselves. A routine is a normal Paws value with some invisible data attached to it, representing Paws code to be executed (as well as another Paws object representing the routine's local scope), and the routine's associated juxtaposition handler simply executes that routine with the value on the right as its argument.

Syntax

pub enum Token {
Name(~str),
Number(float),
String(~str),
LeftParen,
RightParen,
LeftBrace,
RightBrace
}
Network [(R "f",IdentityNode),(R "z",NumberNode 1.0),(R "y",ApplyNode),(AF (R "y"),IdentityNode),(AA 0 (R "y"),InfixNode "/"),(IL (AA 0 (R "y")),NumberNode 34.0),(IR (AA 0 (R "y")),NumberNode 31.0)] [(R "x",IdentityArgument,R "f"),(AF (R "y"),ApplyFunction,R "y"),(AA 0 (R "y"),ApplyArgument 0,R "y"),(AA 1 (R "y"),ApplyArgument 1,R "y"),(R "f",IdentityArgument,AF (R "y")),(IL (AA 0 (R "y")),InfixLeft,AA 0 (R "y")),(IR (AA 0 (R "y")),InfixRight,AA 0 (R "y"))]
f = x; z = 1;
y = f(34 / 31)
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAlD1dL8/TsaurfsMAdFh5tw4712C57BwZX1gbxXmyK9YuQbKWodcj2jrretVtqDG8NAZSR0DRtpCzyq5xvG2IngO+gcgsxAbDmWLa/xIxSVRFwbrogKV1pZ6LaxnCZeFjFAkJ3VUIXZ5nFAcUvBV9RVwONzUP7Qcc80P88T3WhbVWvt16jARiDRjCrMdzv4ahvyfA1JSBQcbmGQbC297DV3sG6yjMp648cuVjhp9rPwqzjRVgSfPioLRdfy0bs9GeWU2u3gXYfoVjL0uVy6bGhjCBvQp5tUlvkXcGVkgQRWgKIQlMw7GfUQMMfCltSoZNNykxjnqIQwZ/XJJ0dFQWkw== [email protected]
#!/usr/bin/env node
(function () {
var Thing, Execution, Label, Association, GetLocals, Juxtapose, Value, parse, Stage, Staging
/* Things */
Thing = function () {
this.members = []
}
Execution = function (code) {