This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* sml *) | |
fun [] append ys = ys | |
| (x :: xs) append ys = x :: (xs append ys); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- fun [] append ys = ys | |
| (x :: xs) append ys = x :: (xs append ys); | |
stdIn:6.12-6.14 Error: illegal function symbol in clause | |
stdIn:6.12-7.48 Error: clauses don't all have same function name | |
stdIn:6.12-7.48 Error: clauses don't all have same number of patterns | |
stdIn:6.12-7.48 Error: types of rules don't agree [tycon mismatch] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test/unit' | |
class ParameterizedTestCase < Test::Unit::TestCase | |
def self.suite | |
method_names = public_instance_methods(true) | |
target_method_names = method_names.find_all do |method_name| | |
method_name =~ /^ptest./ | |
end | |
puts "target_method_names: #{target_method_names.inspect}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MechanicTest < ParameterizedTestCase | |
@@parameter_parameterized = [["Car", Car.new], | |
["Bike", Motorcycle.new], | |
["Truck", Truck.new]] | |
def ptest_operateOnCar(vehicle) | |
myMechanic = Mechanic.new | |
myMechanic.operate(vehicle) | |
assert !vehicle.broken? | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Welcome to scsh 0.7 | |
Type ,? for help. | |
> ,exec ,load load.scm | |
warning: name from opened structure redefined [package-define!] | |
#{package 285 config} | |
srfi-43 | |
#{structure 95 more-structures} | |
warning: name from opened structure redefined [package-define!] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Sojourn(location, map, path) { | |
var marker = createMarker(location, map); | |
path.push(location); | |
this.getLocation = function () { return location; }; | |
this.remove = function () { | |
marker.setMap(null); | |
path.forEach(function (x, i) { | |
if (x.equals(location)) { | |
path.removeAt(i); }});}; | |
console.log("setting remove behavior!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-struct foo (a)) | |
(define-struct bar (a b c)) | |
;; --- | |
;; better syntax could probably be thought of... | |
(struct-dispatch my-var | |
((foo (a) (do-something a)) | |
((bar (a b c) (do-something-else a b c)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<statement> ::= <definition> | |
| <expression> | |
| "return " <expression> | |
<definition> ::= "var" <id> " = " <expression> | |
| "function " <id> " (" <argument-list> ") { " <statements> " }" | |
<statements> ::= <statment> ";\n" <statements> | |
| <statement> ";\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Welcome to Racket v5.0.2. | |
> (require racket) | |
> (define rhino-process (process "rhino")) | |
> (define rhino-stdin (second rhino-process)) | |
> (define rhino-stdout (first rhino-process)) | |
> (define rhino-stderr (fourth rhino-process)) | |
> (display-lines (list "1 + 1") rhino-stdin) | |
> (port->string rhino-stdout) | |
C-c C-cuser break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require rackunit | |
"main.rkt") | |
(provide tea-eval auto-cleanup-process) | |
;; tea-eval : SExp -> (list String String) | |
;; the first string is (hopefully) the output | |
;; the second string is the full output of the command, check this if the first | |
;; doesn't make any sense | |
(define (tea-eval sexp) |
OlderNewer