Changeset 13709 in project


Ignore:
Timestamp:
03/12/09 12:54:05 (11 years ago)
Author:
felix winkelmann
Message:

manual cleanups; added record proposal by Kon; wiki2html ugly but working

Location:
chicken/trunk
Files:
1 added
15 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/TODO

    r13581 r13709  
    11TODO for chicken                                                        -*- Outline -*-
    22================
    3 
    4 
    5 * release
    6 ** Continue merging wiki manual changes
    7    continue from "Unit data-structures"
    83
    94
     
    4136*** mark import-source (module) on plist of imported symbols and use in re-import warning
    4237    doesn't work that easily, try to find another solution
     38*** DSSSL lambda-lists need imports of `chicken' module ("optional", "let-optionals", ...)
     39**** should probably use internal aliases
    4340
    4441** libraries
     
    4845    reported by Jim Ursetto
    4946    reverted original patch, see patches/finalizer-closures.diff
    50 *** Use record-descriptors instead of symbols as 1st slot in structure objects?
    5147
    5248
     
    9288*** ports should have indicator slot about exact type (tcp, file, ...)
    9389*** normalize-pathname: return short name on windows? (mingw/msvc)
     90*** Use record-descriptors instead of symbols as 1st slot in structure objects?
     91**** see Kon's proposal for new record-descriptors in "misc/Chicken Runtime Data Type Proposal"
    9492
    9593** syntax-error
     
    108106** documentation
    109107*** document qs, normalize-pathname
    110 *** write quick-and-dirty wiki-syntax -> HTML converter
    111108
    112109
     
    140137   looping lambda + dispatch (static variable can be used), otherwise similar to
    141138   a conditional
    142 *** new forms (after optimization, prepared language)
    143     [##core#dispatch LAMBDABODY1 ... BODY]
    144     [##core#goto {INDEX} ARGUMENT1 ...}
    145139
    146140** lazy gensyms (see "lazy-gensyms" branch)
  • chicken/trunk/distribution/manifest

    r13581 r13709  
    129129hen.el
    130130scheme-complete.el
    131 html/accessing-external-objects.html
    132 html/acknowledgements.html
    133 html/basic-mode-of-operation.html
    134 html/bibliography.html
    135 html/bugs-and-limitations.html
    136 html/c-interface.html
    137 html/callbacks.html
    138 html/data-representation.html
    139 html/declarations.html
    140 html/modules-and-macros.html
    141 html/deviations-from-the-standard.html
    142 html/embedding.html
    143 html/extensions-to-the-standard.html
     131html/Accessing external objects.html
     132html/Acknowledgements.html
     133html/Basic mode of operation.html
     134html/Bibliography.html
     135html/Bugs and limitations.html
     136html/C interface.html
     137html/Callbacks.html
     138html/Data representation.html
     139html/Declarations.html
     140html/Deviations from the standard.html
     141html/Embedding.html
     142html/Extensions to the standard.html
     143html/Extensions.html
     144html/Foreign type specifiers.html
     145html/Getting started.html
     146html/Getting started~.html
     147html/Interface to external functions and variables.html
     148html/Locations.html
     149html/Modules and macros.html
     150html/Non-standard macros and special forms.html
     151html/Non-standard read syntax.html
     152html/Other support procedures.html
     153html/Overview.html
     154html/Parameters.html
     155html/Supported language.html
     156html/The User's Manual.html
     157html/Unit data-structures.html
     158html/Unit eval.html
     159html/Unit expand.html
     160html/Unit extras.html
     161html/Unit files.html
     162html/Unit library.html
     163html/Unit lolevel.html
     164html/Unit ports.html
     165html/Unit posix.html
     166html/Unit regex.html
     167html/Unit srfi-1.html
     168html/Unit srfi-13.html
     169html/Unit srfi-14.html
     170html/Unit srfi-18.html
     171html/Unit srfi-4.html
     172html/Unit tcp.html
     173html/Unit utils.html
     174html/Using the compiler.html
     175html/Using the interpreter.html
    144176html/faq.html
    145 html/foreign-type-specifiers.html
    146 html/getting-started.html
    147 html/index.html
    148 html/interface-to-external-functions-and-variables.html
    149 html/locations.html
    150 html/non-standard-macros-and-special-forms.html
    151 html/non-standard-read-syntax.html
    152 html/other-support-procedures.html
    153 html/parameters.html
    154 html/supported-language.html
    155 html/unit-data-structures.html
    156 html/unit-ports.html
    157 html/unit-files.html
    158 html/unit-eval.html
    159 html/unit-extras.html
    160 html/unit-library.html
    161 html/unit-lolevel.html
    162 html/unit-posix.html
    163 html/unit-regex.html
    164 html/unit-srfi-1.html
    165 html/unit-srfi-13.html
    166 html/unit-srfi-14.html
    167 html/unit-srfi-18.html
    168 html/unit-srfi-4.html
    169 html/unit-srfi-69.html
    170 html/unit-tcp.html
    171 html/unit-utils.html
    172 html/using-the-compiler.html
    173 html/using-the-interpreter.html
     177html/manual.css
    174178library.scm
    175179lolevel.scm
  • chicken/trunk/manual/Bugs and limitations

    r13683 r13709  
    1414Previous: [[Data representation]]
    1515
    16 Next: [[FAQ]]
     16Next: [[faq]]
  • chicken/trunk/manual/C interface

    r13683 r13709  
    356356=== Notes:
    357357
    358 Scheme procedures can call C functions, and C functions can call
    359 Scheme procedures, but for every pending C stack frame, the available
    360 size of the first heap generation (the ''nursery'') will be decreased,
    361 because the C stack is identical to the nursery. On systems with a small
    362 nursery this might result in thrashing, since the C code between the
    363 invocation of C from Scheme and the actual calling back to Scheme might
    364 build up several stack-frames or allocates large amounts of stack data.
    365 To prevent this it is advisable to increase the default nursery size,
    366 either when compiling the file (using the {{-nursery}} option)
    367 or when running the executable (using the {{-:s}} runtime option).
    368 
    369 Calls to Scheme/C may be nested arbitrarily, and Scheme
    370 continuations can be invoked as usual, but keep in mind that C stack
    371 frames will not be recovered, when a Scheme procedure call from C does
    372 not return normally.
    373 
    374 When multiple threads are running concurrently, and control switches
    375 from one thread to another, then the continuation of the current thread
    376 is captured and saved. Any pending C stack frame still active from a
    377 callback will remain on the stack until the threads is re-activated
    378 again. This means that in a multithreading situation, when C callbacks
    379 are involved, the available nursery space can be smaller than expected.
    380 So doing many nested Scheme->C->Scheme calls can reduce the available
    381 memory up to the point of thrashing. It is advisable to have only a
    382 single thread with pending C stack-frames at any given time.
    383 
    384 Pointers to Scheme data objects should not be stored in local or
    385 global variables while calling back to Scheme.  Any Scheme object not
    386 passed back to Scheme will be reclaimed or moved by the garbage collector.
    387 
    388 Calls from C to Scheme are never tail-recursive.
    389 
    390 Continuations captured via {{call-with-current-continuation}}
    391 and passed to C code can be invoked like any other Scheme procedure.
     358* Scheme procedures can call C functions, and C functions can call
     359  Scheme procedures, but for every pending C stack frame, the available
     360  size of the first heap generation (the ''nursery'') will be decreased,
     361  because the C stack is identical to the nursery. On systems with a small
     362  nursery this might result in thrashing, since the C code between the
     363  invocation of C from Scheme and the actual calling back to Scheme might
     364  build up several stack-frames or allocates large amounts of stack data.
     365  To prevent this it is advisable to increase the default nursery size,
     366  either when compiling the file (using the {{-nursery}} option)
     367  or when running the executable (using the {{-:s}} runtime option).
     368* Calls to Scheme/C may be nested arbitrarily, and Scheme
     369  continuations can be invoked as usual, but keep in mind that C stack
     370  frames will not be recovered, when a Scheme procedure call from C does
     371  not return normally.
     372* When multiple threads are running concurrently, and control switches
     373  from one thread to another, then the continuation of the current thread
     374  is captured and saved. Any pending C stack frame still active from a
     375  callback will remain on the stack until the threads is re-activated
     376  again. This means that in a multithreading situation, when C callbacks
     377  are involved, the available nursery space can be smaller than expected.
     378  So doing many nested Scheme->C->Scheme calls can reduce the available
     379  memory up to the point of thrashing. It is advisable to have only a
     380  single thread with pending C stack-frames at any given time.
     381* Pointers to Scheme data objects should not be stored in local or
     382  global variables while calling back to Scheme.  Any Scheme object not
     383  passed back to Scheme will be reclaimed or moved by the garbage collector.
     384* Calls from C to Scheme are never tail-recursive.
     385* Continuations captured via {{call-with-current-continuation}}
     386  and passed to C code can be invoked like any other Scheme procedure.
    392387
    393388
  • chicken/trunk/manual/Extensions

    r13683 r13709  
    526526
    527527<enscript highlight=scheme>
    528 (compile -s -O2 -d1 my-ext.scm)   ; dynamically loadable "normal" version
    529 (compile -c -O2 -d1 my-ext -unit my-ext)  ; statically linkable version
    530 (install-extension
    531   'my-ext
    532   '("my-ext.so" "my-ext.o")
    533   '((static "my-ext.o")) )
     528 (compile -s -O2 -d1 my-ext.scm)   ; dynamically loadable "normal" version
     529 (compile -c -O2 -d1 my-ext -unit my-ext)  ; statically linkable version
     530 (install-extension
     531   'my-ext
     532   '("my-ext.so" "my-ext.o")
     533   '((static "my-ext.o")) )
    534534</enscript>
    535535
  • chicken/trunk/manual/Foreign type specifiers

    r13683 r13709  
    9797As {{blob}}, but guaranteed not to be {{#f}}.
    9898
    99 === u8vector u16vector u32vector s8vector s16vector s32vector f32vector f64vector
     99=== u8vector
     100=== u16vector
     101=== u32vector
     102=== s8vector
     103=== s16vector
     104=== s32vector
     105=== f32vector
     106=== f64vector
    100107
    101108A SRFI-4 number-vector object, passed as a pointer to its contents.
     
    103110These type specifiers are not allowed as return types.
    104111
    105 === nonnull-u8vector nonnull-u16vector nonnull-u32vector nonnull-s8vector nonnull-s16vector nonnull-s32vector nonnull-f32vector nonnull-f64vector
     112=== nonnull-u8vector
     113=== nonnull-u16vector
     114=== nonnull-u32vector
     115=== nonnull-s8vector
     116=== nonnull-s16vector
     117=== nonnull-s32vector
     118=== nonnull-f32vector
     119=== nonnull-f64vector
    106120
    107121As {{u8vector ...}}, but guaranteed not to be {{#f}}.
  • chicken/trunk/manual/Unit library

    r13686 r13709  
    114114
    115115{{maximum-flonum}}
     116
    116117{{minimum-flonum}}
     118
    117119{{flonum-radix}}
     120
    118121{{flonum-epsilon}}
     122
    119123{{flonum-precision}}
     124
    120125{{flonum-decimal-precision}}
     126
    121127{{flonum-maximum-exponent}}
     128
    122129{{flonum-minimum-exponent}}
     130
    123131{{flonum-maximum-decimal-exponent}}
     132
    124133{{flonum-minimum-decimal-exponent}}
    125134
  • chicken/trunk/manual/Unit lolevel

    r13683 r13709  
    780780
    781781<enscript highlight=scheme>
    782 ;;; Replace arbitrary procedure with tracing one:
    783 
    784 (mutate-procedure my-proc
    785   (lambda (new)
    786     (lambda args
    787       (printf "~s called with arguments: ~s~%" new args)
    788       (apply new args) ) ) )
     782 ;;; Replace arbitrary procedure with tracing one:
     783
     784 (mutate-procedure my-proc
     785   (lambda (new)
     786     (lambda args
     787       (printf "~s called with arguments: ~s~%" new args)
     788       (apply new args) ) ) )
    789789</enscript>
    790790
  • chicken/trunk/manual/Unit regex

    r13683 r13709  
    155155
    156156<enscript highlight=scheme>
    157 (string-substitute "([0-9]+) (eggs|chicks)"
    158                    "\\2 (\\1)" "99 eggs or 99 chicks" 2)
     157(string-substitute "([0-9]+) (eggs|chicks)" "\\2 (\\1)" "99 eggs or 99 chicks" 2)
    159158=> "99 eggs or chicks (99)"
    160159</enscript>
     
    175174
    176175<enscript highlight=scheme>
    177 (string-substitute* "<h1>Hello, world!</h1>"
    178                     '(("<[/A-Za-z0-9]+>" . "")))
     176(string-substitute* "<h1>Hello, world!</h1>" '(("<[/A-Za-z0-9]+>" . "")))
    179177
    180178=>  "Hello, world!"
  • chicken/trunk/manual/Unit tcp

    r13683 r13709  
    182182
    183183<enscript highlight=scheme>
    184 ; client.scm
    185 (declare (uses tcp))
    186 (define-values (i o) (tcp-connect "localhost" 4242))
    187 (write-line "Good Bye!" o)
    188 (print (read-line i))
     184 ; client.scm
     185 (declare (uses tcp))
     186 (define-values (i o) (tcp-connect "localhost" 4242))
     187 (write-line "Good Bye!" o)
     188 (print (read-line i))
    189189</enscript>
    190190
    191191<enscript highlight=scheme>
    192 ; server.scm
    193 (declare (uses tcp))
    194 (define l (tcp-listen 4242))
    195 (define-values (i o) (tcp-accept l))
    196 (write-line "Hello!" o)
    197 (print (read-line i))
    198 (close-input-port i)
    199 (close-output-port o)
     192 ; server.scm
     193 (declare (uses tcp))
     194 (define l (tcp-listen 4242))
     195 (define-values (i o) (tcp-accept l))
     196 (write-line "Hello!" o)
     197 (print (read-line i))
     198 (close-input-port i)
     199 (close-output-port o)
    200200</enscript>
    201201
  • chicken/trunk/manual/faq

    r13683 r13709  
    2626
    2727* As far as we know, CHICKEN is the first implementation of Scheme that uses Henry Baker's [[http://home.pipeline.com/~hbaker1/CheneyMTA.html|Cheney on the M.T.A]] concept.
    28 
    29 ==== Why call it 'Chicken'?
    30 
    31 According to [[http://chicken.wiki.br/felix winkelmann|felix]]:
    32 
    33 > Well, it's pretty boring, really: when I started the project and needed some
    34 > name, the first thing that met my eyes was the "chicken" (actually a disguised penguin)
    35 > from the Wallace + Gromit movie...
    36 > And then there is of course the ever occurring chicken-and-egg problem
    37 > with bootstrapped compilers.
    3828
    3929==== What should I do if I find a bug?
  • chicken/trunk/misc/manual.css

    r13683 r13709  
    2323}
    2424
    25 TT {
    26     font-family: "Andale Mono", monospace;
    27 /* font-size: 1.2em; */
     25TABLE {
     26    font: 9pt "Lucida Grande", "Verdana", sans-serif;
    2827}
    2928
  • chicken/trunk/rules.make

    r13612 r13709  
    12201220# distribution files
    12211221
    1222 .PHONY: distfiles dist
    1223 
    1224 distfiles: buildsvnrevision library.c eval.c expand.c chicken-syntax.c \
     1222.PHONY: distfiles dist html
     1223
     1224distfiles: html buildsvnrevision library.c eval.c expand.c chicken-syntax.c \
    12251225        data-structures.c ports.c files.c extras.c lolevel.c utils.c \
    12261226        tcp.c srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c \
     
    12351235dist: distfiles
    12361236        $(CSI) -s $(SRCDIR)scripts/makedist.scm
     1237
     1238html:
     1239        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(SRCDIR)html
     1240        $(COPY_COMMAND) $(SRCDIR)misc/manual.css $(SRCDIR)html
     1241        $(CSI) -s $(SRCDIR)scripts/wiki2html.scm --outdir=html manual/*
    12371242
    12381243# cleaning up
     
    13331338        LD_LIBRARY_PATH=$$here DYLD_LIBRARY_PATH=$$here PATH=$$here:$$PATH \
    13341339        csi -s cscbench.scm $(BENCHMARK_OPTIONS)
     1340
     1341# create HTML from manual
  • chicken/trunk/scripts/makedist.scm

    r10522 r13709  
    33
    44(define *release* #f)
    5 (define *test* #f)
    65
    76(load-relative "tools.scm")
     
    4746(run (gmake -f ,(conc "Makefile." *platform*) distfiles ,@*makeargs*))
    4847(release *release*)
    49 
    50 (when *test*
    51   (let* ((bdir "/tmp/test-dist-build")
    52          (sdir "/tmp/test-dist-build/chicken-*")
    53          (bbdir "/tmp/test-dist-build/build")
    54          (idir "/tmp/test-dist-build/inst")
    55          (tgz (conc "chicken-" BUILDVERSION ".tar.gz")) )
    56     (run (mkdir -p ,bdir))
    57     (run (tar xfz ,(conc "site/" tgz) -C ,bdir))
    58     (run (cd ,sdir ";" make -f ,(conc "Makefile." *platform*)
    59              install (conc "PREFIX=" bdir "/inst")))
    60     (run (cd ,idir ";" bin/chicken-setup -dv bloom-filter))
    61     (run (cd ,idir ";" "CSI_OPTIONS= echo ,r |" bin/csi -n -R bloom-filter))
    62     (run (rm -fr ,sdir ,idir)) ) )
  • chicken/trunk/scripts/wiki2html.scm

    r13686 r13709  
    33; usage: wiki2html <INPUTFILE >OUTPUTFILE
    44
     5
     6(load-relative "tools.scm")
    57
    68(use regex srfi-1 extras utils srfi-13 posix)
     
    3335  '(: (* space) #\; (submatch (*? any)) #\space #\: #\space (submatch (* any))))
    3436
     37(define +d-head+ '(: (* space) #\; (submatch (* any))))
    3538(define +u-list+ '(: (* space) (submatch (>= 1 #\*)) (* space) (submatch (* any))))
    3639(define +o-list+ '(: (* space) (submatch (>= 1 #\*)) #\# (* space) (submatch (* any))))
     
    4144       ,+header+
    4245       ,+d-list+
     46       ,+d-head+
    4347       ,+u-list+
    4448       ,+o-list+
     
    127131                  (fprintf out "<dt>~a</dt><dd>~a</dd>~%"
    128132                           (inline (second m)) (inline (or (third m) "")))))
     133               ((string-match (rx +d-head+) ln) =>
     134                (lambda (m)
     135                  (push-tag 'dl out)
     136                  (set! *list-continuation* #t)
     137                  (fprintf out "<dt>~a</dt>~%" (inline (second m)))))
    129138               ((string-match (rx +u-list+) ln) =>
    130139                (lambda (m)
     
    232241;;; Run it
    233242
     243(define *outdir* ".")
     244
    234245(define (main args)
    235   (let ((outdir "."))
    236     (let loop ((args args))
    237       (match args
    238         (()
    239          (print "usage: wiki2html [-o DIRECTORY] PAGEFILE ...")
    240          (exit 1))
    241         (("-o" dir . more)
    242          (set! outdir dir)
    243          (loop more))
    244         ((files ...)
    245          (let ((dirs (delete-duplicates (map pathname-directory files) string=?)))
    246            (set! *manual-pages* (map pathname-strip-directory (append-map directory dirs)))
    247            (for-each
    248             (lambda (file)
    249               (print file)
    250               (with-input-from-file file
    251                 (lambda ()
    252                   (with-output-to-file (pathname-replace-directory (string-append file ".html") outdir)
    253                     (cut convert (pathname-file file))))))
    254             files)))))))
    255 
    256 
    257 (main (command-line-arguments))
     246  (let loop ((args args))
     247    (match args
     248      (()
     249       (print "usage: wiki2html [--outdir=DIRECTORY] PAGEFILE ...")
     250       (exit 1))
     251      ((files ...)
     252       (let ((dirs (delete-duplicates (map pathname-directory files) string=?)))
     253         (set! *manual-pages* (map pathname-strip-directory (append-map directory dirs)))
     254         (for-each
     255          (lambda (file)
     256            (print file)
     257            (with-input-from-file file
     258              (lambda ()
     259                (with-output-to-file (pathname-replace-directory (string-append file ".html") *outdir*)
     260                  (cut convert (pathname-file file))))))
     261          files))))))
     262
     263(main (simple-args))
Note: See TracChangeset for help on using the changeset viewer.