Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
Number primitive example, '2.3' String primitive example, "hi" Tuple primitive example, ['1', "a"] Operator like operator example, '2' + '2' Keyword like operator example, println "hello world" Function like operator example find ["c", ["a", "c", "b"]] Simple constructor example {type "integer", name "n"} Input: {type "type", name "list"} {type "virtual binary operator", name "add", left "list", returns "void"} {type "virtual binary operator", name "get", left "list", right "integer"} {type "virtual unary operator", name "get", argument "list"} {type "unary operator", name "concatenate", argument "[list, list]", returns "list", does ( {type "integer", name "n", value '0'}; while [(n < size argument[1]), (argument[0] add (argument[1] get n))]; return argument[0]; )} {type "binary operator", name "+=", left "list, right "list", returns "list", does (concatenate [left, right])} {type "type", name "linked list", parent "list", adjectives ["of"], types { type "type", name "node", members [["node, "next"], ["node, "previous"] } members [["node", "head"] ["node", "tail"]]} {type "linked list", of "integer", name "samplelist"} samplelist add '23' print samplelist Output: Compiler error, operator "list add *" is virtual. If you were to define a "linked list add *" operator then it would work.
This paste will be private.
From the Design Piracy series on my blog: