- The most complete reference I can find for the
2htdp
language is [here][htdp2ereference]. - The tips outlined here will not result in files that can be submitted for the peer-assessment assignments
- See [here][assessments] for details.
- In the
racket
repl, by default named* Racket REPL *
, you can use,enter lang/htdp-beginner
to put it into the restrictedhtdp-beginner
language mode. (NOTE: I'm not yet sure if this refers to the first or second edition of HtDP BSL.) (NOTE: This doesn't really give you all the restrictions)- Alternatively, use
M-: (switch-to-geiser-module "lang/htdp-beginner") RET
to havegeiser
do it for you. - This will allow you to play around within the BSL; be aware that this means a lot of functions will not be
- Alternatively, use
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
stdIn:1.2-2.6 Error: operator and operand don't agree [tycon mismatch] | |
operator domain: int list * int | |
operand: int list | |
in expression: | |
remove (1 :: 2 :: 3 :: <exp> :: <exp>) |
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
Standard ML of New Jersey v110.76 [built: Fri Oct 11 16:38:25 2013] | |
- use "hw1.sml"; | |
[opening hw1.sml] | |
hw1.sml:29.18-30.33 Error: operator and operand don't agree [type mismatch] | |
operator domain: {2:'Y; 'Z} | |
operand: date list | |
in expression: | |
(fn {2=2,...} => 2) d | |
uncaught exception Error |
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
qfunction chrubylib_set_color { | |
if [[ -t 1 || -t 2 ]]; then | |
if tput setaf 0 >/dev/null 2>&1; then | |
chruby_coff=$(tput sgr0) | |
chruby_bold=$(tput bold) | |
chruby_red=${chruby_bold}$(tput af 1) | |
chruby_green=${chruby_bold}$(tput af 2) | |
chruby_yellow=${chruby_bold}$(tput af 3) | |
chruby_blue=${chruby_bold}$(tput af 4) | |
else |
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 chrubylib_set_color { | |
if [[ -t 1 || -t 2 ]]; then | |
if tput setaf 0 >/dev/null 2>&1; then | |
chruby_coff=$(tput sgr0) | |
chruby_bold=$(tput bold) | |
chruby_red=${chruby_bold}$(tput af 1) | |
chruby_green=${chruby_bold}$(tput af 2) | |
chruby_yellow=${chruby_bold}$(tput af 3) | |
chruby_blue=${chruby_bold}$(tput af 4) | |
else |
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
package funsets | |
import common._ | |
/** | |
* 2. Purely Functional Sets. | |
*/ | |
object FunSets { | |
/** | |
* We represent a set by its characteristic function, i.e. |
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
package funsets | |
import org.scalatest.FunSuite | |
import org.junit.runner.RunWith | |
import org.scalatest.junit.JUnitRunner | |
/** | |
* This class is a test suite for the methods in object FunSets. To run | |
* the test suite, you can either: |
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
Test inspect type at point. | |
. | |
...handling :connected | |
. | |
...handling :full-typecheck-finished | |
. | |
Test inspect type in range. |
Students who have more advanced knowledge of computers and programming may be interested in more powerful ways to interact with racket programs.
As this thread presupposes an existing competence level (because you're advanced users), I will not be covering installation instructions. Emacs is available on Windows, Mac OSX, and Linux.
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
after deleting elpa/git-commit-mode* and answering "no" to "Reread from disk into git-commit-mode-...?" | |
Debugger entered--Lisp error: (void-function nil) | |
nil() | |
run-hooks(change-major-mode-after-body-hook prog-mode-hook emacs-lisp-mode-hook) | |
apply(run-hooks (change-major-mode-after-body-hook prog-mode-hook emacs-lisp-mode-hook)) | |
run-mode-hooks(emacs-lisp-mode-hook) | |
emacs-lisp-mode() | |
autoload-find-file("git-commit-mode-pkg.el") |
NewerOlder