The following is a collection of notes generated while learning CHICKEN Scheme.
Function definition using defun
:
(define (my-name arg1 arg2)
(body...))
Functions that return true (#t
) or false (#f
) are called predicates:
<!doctype html> | |
<!--[if lt IE 7 ]> <html lang="en" class="ie6"> <![endif]--> <!--[if IE 7 ]> <html lang="en" class="ie7"> <![endif]--> <!--[if IE 8 ]> <html lang="en" class="ie8"> <![endif]--> <!--[if IE 9 ]> <html lang="en" class="ie9"> <![endif]--> | |
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="author" content=""> |
(function () { | |
"use strict"; | |
var Todos = []; | |
var Todo = function () { | |
this.title = null; | |
this.isDone = false; | |
}; | |
$(document).ready(function () { |
<!doctype html> | |
<!--[if lt IE 7 ]> <html lang="en" class="ie6"> <![endif]--> | |
<!--[if IE 7 ]> <html lang="en" class="ie7"> <![endif]--> | |
<!--[if IE 8 ]> <html lang="en" class="ie8"> <![endif]--> | |
<!--[if IE 9 ]> <html lang="en" class="ie9"> <![endif]--> | |
<!--[if (gt IE 9)|!(IE)]><!--> | |
<html lang="en"> | |
<!--<![endif]--> | |
<head> | |
<meta charset="UTF-8"> |
(function () { | |
"use strict"; | |
var Todos = []; | |
// Model - Entities | |
var Todo = function () { | |
this.title = null; | |
this.isDone = false; | |
}; |
(function () { | |
"use strict"; | |
var Todos = []; | |
// Model - Entities | |
var Todo = function (options) { | |
this.title = options.title; | |
this.isDone = options.isDone; | |
}; |
private void printDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs ev) | |
{ | |
float linesPerPage = 0; | |
float yPosition = 0; | |
int count = 0; | |
float leftMargin = ev.MarginBounds.Left; | |
float topMargin = ev.MarginBounds.Top; | |
string line = null; | |
Font printFont = txtRazonSocial.Font; | |
SolidBrush myBrush = new SolidBrush(Color.Black); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<div id="container"></div> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> | |
<script type="text/javascript" src="https://raw.github.com/gosukiwi/pochitto/master/pochitto.js"></script> | |
<script type="text/javascript"> |
private string parsePredicateExpression(Expression body) | |
{ | |
BinaryExpression binary = (BinaryExpression)body; // cast | |
string separator = body.NodeType == ExpressionType.OrElse ? " OR " : " AND "; | |
if (body.NodeType == ExpressionType.AndAlso || body.NodeType == ExpressionType.OrElse) | |
{ // If we are working with several ANDs or ORs | |
return "(" + parsePredicateExpression(binary.Left) + separator + parsePredicateExpression(binary.Right) + ")"; | |
} | |
else |
(define-syntax hash | |
(er-macro-transformer | |
(lambda (expr r c) ; expression rename compare | |
(let ((body (cdr expr))) | |
;; code-expansion, self-executable lambda | |
`(((lambda () | |
(let ((table make-strong-eq-hash-table)) | |
,(let loop | |
((pairs body)) | |
(if (> (length pairs) 2) |