diff --git a/info.rkt b/info.rkt index 8305531..fce4e2b 100644 --- a/info.rkt +++ b/info.rkt @@ -1,4 +1,4 @@ #lang info (define collection "sugar") -(define scribblings '(("scribblings/sugar.scrbl" ()))) +(define scribblings '(("scribblings/sugar.scrbl" (multi-page)))) (define deps '("describe")) \ No newline at end of file diff --git a/macro.rkt b/macro.rkt index 358a919..f157e3b 100644 --- a/macro.rkt +++ b/macro.rkt @@ -15,18 +15,18 @@ ;(define foo (λ(x) (add1 x))) -(define->macro foo (λ(x) (add1 x))) +;(define->macro foo (λ(x) (add1 x))) -(foo 4) -(map foo '(2 4 6)) +;(foo 4) +;(map foo '(2 4 6)) ;(define (bar x) (add1 x)) -(define->macro (bar x y) (+ x y)) +;(define->macro (bar x y) (+ x y)) -(bar 4 1) -(map bar '(2 4 6) '(2 4 6)) +;(bar 4 1) +;(map bar '(2 4 6) '(2 4 6)) -(define-syntax zam (add1 x)) +;(define-syntax zam (add1 x)) -(zam 4) -(map zam '(2 4 6)) \ No newline at end of file +;(zam 4) +;(map zam '(2 4 6)) \ No newline at end of file diff --git a/scribblings/coerce.scrbl b/scribblings/coerce.scrbl index f2660fa..2862c43 100644 --- a/scribblings/coerce.scrbl +++ b/scribblings/coerce.scrbl @@ -1,6 +1,6 @@ #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)) @(my-eval `(require sugar)) diff --git a/scribblings/len.scrbl b/scribblings/len.scrbl new file mode 100644 index 0000000..28411da --- /dev/null +++ b/scribblings/len.scrbl @@ -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. \ No newline at end of file diff --git a/scribblings/sugar.scrbl b/scribblings/sugar.scrbl index ea5e459..1378504 100644 --- a/scribblings/sugar.scrbl +++ b/scribblings/sugar.scrbl @@ -1,6 +1,6 @@ #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)) @(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["len.scrbl"] + + @section{License & source code} This module is licensed under the LGPL.