This file contains hidden or 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
; (begin | |
; <FunctionCall#1> | |
; <FunctionCall#2> | |
; ... | |
; <ReturnFunctionCall>) | |
; ; executes a sequence of function calls, one at a time | |
; ; returns the value of the last one | |
; vend/outside-stock : number -> string or number |
This Gist was automatically created by Carbide, a free online programming environment.
This Gist was automatically created by Carbide, a free online programming environment.
If you have a bunch of structs with common properties or functions (in the English sense, not the CS sense), it makes sense to define a parent type (or base type) encoding those common properties and functions, and have other types inherit those properties and functions from the parent.
If type A inherits from type B, then A is a subtype (or child type) of B. A subtype is a "more specific" version of its parent type.
Here is the syntax for declaring a subtype:
This file contains hidden or 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
;; Conditionals | |
(require 2htdp/image) | |
(require cs111/iterated) | |
;; boolean is one of | |
;; - true (#true, #t) | |
;; - false (#false, #f) | |
;; and : boolean, boolean, ... -> boolean |
This file contains hidden or 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
Show hidden characters
{ | |
// Evaluate file in the open SublimeREPL. | |
// Depends on you creating the Packages/User/EvalInREPL.sublime-macro file. | |
{ "keys": ["super+r"], "command": "run_macro_file", "args": { "file": "Packages/User/EvalInREPL.sublime-macro" }, | |
"context": [ | |
{ "key": "selector", "operator": "equal", "operand": "source.elm" } | |
] | |
}, | |
// Reindent selection on tab |