pull/2/head
Matthew Butterick 11 years ago
parent ebbdd403f5
commit 199540832a

@ -1,4 +1,4 @@
#lang info #lang info
(define collection "sugar") (define collection "sugar")
(define scribblings '(("scribblings/sugar.scrbl" ()))) (define scribblings '(("scribblings/sugar.scrbl" (multi-page))))
(define deps '("describe")) (define deps '("describe"))

@ -15,18 +15,18 @@
;(define foo (λ(x) (add1 x))) ;(define foo (λ(x) (add1 x)))
(define->macro foo (λ(x) (add1 x))) ;(define->macro foo (λ(x) (add1 x)))
(foo 4) ;(foo 4)
(map foo '(2 4 6)) ;(map foo '(2 4 6))
;(define (bar x) (add1 x)) ;(define (bar x) (add1 x))
(define->macro (bar x y) (+ x y)) ;(define->macro (bar x y) (+ x y))
(bar 4 1) ;(bar 4 1)
(map bar '(2 4 6) '(2 4 6)) ;(map bar '(2 4 6) '(2 4 6))
(define-syntax zam (add1 x)) ;(define-syntax zam (add1 x))
(zam 4) ;(zam 4)
(map zam '(2 4 6)) ;(map zam '(2 4 6))

@ -1,6 +1,6 @@
#lang scribble/manual #lang scribble/manual
@(require scribble/eval (for-label racket "../main.rkt" sugar)) @(require scribble/eval (for-label racket sugar))
@(define my-eval (make-base-eval)) @(define my-eval (make-base-eval))
@(my-eval `(require sugar)) @(my-eval `(require sugar))

@ -0,0 +1,15 @@
#lang scribble/manual
@(require scribble/eval (for-label racket sugar))
@(define my-eval (make-base-eval))
@(my-eval `(require sugar))
@title{Len}
@defmodule[sugar/len]
@defproc[
(len
[x (or/c list? string? symbol? vector? hash? integer? set?)])
integer?]
Convert @racket[_x] to a length in the least surprising way possible, or raise an error if it can't be done.

@ -1,6 +1,6 @@
#lang scribble/manual #lang scribble/manual
@(require scribble/eval (for-label racket "../main.rkt" sugar)) @(require scribble/eval (for-label racket sugar))
@(define my-eval (make-base-eval)) @(define my-eval (make-base-eval))
@(my-eval `(require sugar)) @(my-eval `(require sugar))
@ -23,6 +23,9 @@ After that, you can update the package from the command line:
@include-section["coerce.scrbl"] @include-section["coerce.scrbl"]
@include-section["len.scrbl"]
@section{License & source code} @section{License & source code}
This module is licensed under the LGPL. This module is licensed under the LGPL.

Loading…
Cancel
Save