Quantcast
Channel: emoticode
Browsing all 15 articles
Browse latest View live

Scheme - Advanced Pi Approximation

(+ (- (+ (* 176 (atan (/ 1 57))) (* 28 (atan (/ 1 239)))) (* 48 (atan (/ 1 682)))) (* 96 (atan (/ 1 12943 ...

View Article



Scheme - Shorter Pi Approximation

(+ 2 (expt (/ 276694819753963 226588) (/ 1 158 ...

View Article

Scheme - scheme: check for optional arguments

(define-macro (p r . otherstuff) `(if (null? (list ,@otherstuff)) (print ,r) (print ,@otherstuff))) (p 'c 'ciao ...

View Article

Scheme - thi lap trinh ham

(define (pitagore a b) (let ((a2 (* a a)) (b2 (* b b))) (sqrt (+ a2 b2)))) (define (divisibleBy? number divisor) (= (remainder number divisor) 0)) ; kiem tra 1 nam co nhua hay ko ( ...

View Article

Scheme - list flatten

(define list-flatten (lambda (l) (cond ((null? l) '()) ((atom? l) (list l)) (#t (append (flatten (car l)) (flatten (cdr l ...

View Article


Scheme - Interpreter for Lectures 15-16

;;================================================================================ ;;== Lecture 15 Interpreter ...

View Article

Scheme - scheme: replace a string

(define string-replace (lambda (s match replacement) (let ((ll (string->list s)) (match1 (char match)) (replacement1 (char replacement))) (if (= (string ...

View Article

Scheme - Pi Approximation in Scheme

(expt (- 100 (/ (+ (expt 2125 3) (expt 214 3) (expt 30 3) (expt 37 2)) (expt 82 5))) .25 ...

View Article


Scheme - Grouping keys of an associative list

;; it requires srfi-1 (lists), for fold-right. (define (alist-group-keys alist) (let ((create-cons-cell-or-append-to-existing (lambda (current acum) (let* ((key (car ...

View Article


Scheme - Change list in place : scheme/impromtu

(define-macro (change-list lst) `(set! ,lst (map (lambda (i) (+ i 1)) ,lst))) (define mylist '(1 2 3 4 5)) (change-list mylist ...

View Article

Scheme - evolutionOrgPerson+ mozillaAbPersonAlpha ldiff to openldap 2.4

dn: cn=misc,cn=schema,cn=config objectClass: olcSchemaConfig cn: misc olcObjectIdentifier: OLcfg 1.3.6.1.4.1.4203.1.12.2 olcObjectIdentifier: OLcfgAt OLcfg:3 olcObjectIdentifier: OLcfgGlAt ...

View Article

Scheme - thi lth

;Bo ngoac (define (lamPhangDS L) (cond ((null? L) '()) ((list? (car L)) (append (lamPhangDS (car L)) (lamPhangDS (cdr L)))) (else (cons (car L) (lamPhangDS (cdr L)))))) (lamPhangDS '(a b c (d ...

View Article

Scheme - Scheme: find a substring

(let loop ((i 0) (j 20) ;; comparison value: it decreases at each recursion (except the first one) (topvalue 20)) ;; komodo value : must be equal to j at the beginning ( ...

View Article


Scheme - cons

(setq alist '(a b c)) ;(a b c) (cons '1 alist) ;(1 a b c) (prin1 alist) ;(a b c) (setq alist (cons '1 alist)) (prin1 alist) ;(1 a b c ...

View Article

Scheme - Function split list to lists of length n.

(define (skip list n) (cond ((null? list ...

View Article

Browsing all 15 articles
Browse latest View live




Latest Images