Skip to content

Instantly share code, notes, and snippets.

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>)
@zendeavor
zendeavor / hw1.sml
Last active December 25, 2015 09:39
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
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
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
package funsets
import common._
/**
* 2. Purely Functional Sets.
*/
object FunSets {
/**
* We represent a set by its characteristic function, i.e.
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:
Test inspect type at point.
.
...handling :connected
.
...handling :full-typecheck-finished
.
Test inspect type in range.

Troubleshooting

  • 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 restricted htdp-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 have geiser 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
@zendeavor
zendeavor / powertools.md
Created September 5, 2013 13:02
powertools markdown for iosdp

Students who have more advanced knowledge of computers and programming may be interested in more powerful ways to interact with racket programs.

Here are some options

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.

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")