TODO list for Chicken								-*- Outline -*-


* creating lots of threads (1000) + repl seems to hang - something's wrong in the
  scheduler (situation: primordial blocked for I/O and others ready)

* ##core#global-ref should warn on unexported variable

* Some solution for embedding stringified non-standard literals in compiled code

* eval: ##core#named-lambda could use name for lambda-decoration

* remove deprecated features

* inline-defs for generated accessors in define-record and define-record-type [Benedikt]
  (or option `-inline-record-accessors' ?)

* foreign-types
** `string-list': NULL-terminated array of C-strings

* csi: stop canonicalizing options even if "-s" is collapsed with other options

* macroexpander: `me' (macroenvironment) - is not really needed anymore.

* a `read-string' primitive port-method would probably speed up input considerably...

* hen.el
** `#| ... |#' colored as comment would be nice
** properly colored `(define ((...' would be nice as well

* reader
** more speed
** #/.../ (regexps) ?, or "#rx<delim>...<delim>" ?
** PLT's (X . OP . Y) ?

* chicken-setup
** `-uninstall' doesn't remove executables (their names are registered nowhere)

* manual
** example for C_gc_protect()
** document class-linerization

* Can we implement a size-independent wchar_t foreign type?

* runtime
** Better info for platforms where dload isn't supported
** check finalizers using a different method than interrupts? [Suggested by Bruce Hoult]
** better overflow-detection for fixnum plus/minus (see "Hacker's Delight")
** possible bug: free() of malloc'd blocks that have been aligned (like `tospace_start')
** random scatter hash-func (cii book) ?

* regexes
** [PCRE] should `regexp' use `pcre_study()'? (benchmark)

* Compiler
** speed up closure conversion
** warn if undefined globals are declared hidden [Peter Wang]
** explicit rest-consing with (##core#inline_allocate "C_a_i_list" ...) is unneeded if the restvar is never used
** gen-lit and friends do not check tmpstack overflow
** gen-lit (and friends) could generate better code for lists with immediate items
** setter-optimization for `let' doesn't work with nallch, why?

* Optimizations
** hashing of case-values?
** compile-time format-string checks?
** lexical refs/assigns could be cached in local variables
** Treat ids in inline-declarations as known, but inhibit customization/argument dropping

* FFI
** optional args?
** This fails:
void XML_SetStartElementHandler(struct XML_ParserStruct *p, void (*)(void *, const char *name, const char **attrs));
(cast omits first "const" specifier)

* tcp
** reverse DNS lookup (gethostbyaddr)

* lolevel
[procedure] (object-traverse X PROC)
[parameter] byte-vector-allocator -> bytes -> X		(uses by SRFI-4 as well)

* TinyCLOS
** this bombs with -block (reported by Benedikt), probably caused by ##core#global-ref:
(declare (uses tinyclos))

(define-method (print-bool (b <boolean>))
  (display (if b "true\n" "false\n")))


(define-class <toggle> ()
  (state))

(define-class <nth-toggle> (<toggle>)
  (count-max counter))


(define-method (initialize (t <toggle>) initargs)
  (call-next-method)
  (initialize-slots t initargs))

(define-method (initialize (n-t <nth-toggle>) initargs)
  (call-next-method)
  (initialize-slots n-t initargs)
  (slot-set! n-t 'counter 0))


(define-method (activate! (t <toggle>))
  (slot-set! t 'state (not (slot-ref t 'state)))
  t)

(define-method (activate! (n-t <nth-toggle>))
  (let ((counter (+ 1 (slot-ref n-t 'counter))))
    (slot-set! n-t 'counter counter)
    (if (>= counter (slot-ref n-t 'count-max))
      (begin (slot-set! n-t 'state (not (slot-ref n-t 'state)))
             (slot-set! n-t 'counter 0)))
    n-t))

(define-method (value? (t <toggle>))
  (slot-ref t 'state))


  (let ((ntog (make <nth-toggle> 'state #t 'count-max 3)))
    (do ((i 0 (+ i 1))) ((= i 8))
         (print-bool (value? (activate! ntog)))))

* Platforms
** may `regparm' attribute be a problem on some machines? (as suggested by gcc 3.4 docs)
** add Hans Hbner's ecos patches
