Re: (declare (pure ...))

2024-02-10 Thread siiky via
Hi Al, On a practical level, I would be sad if vector-ref, for example, was "impure", and thus compiling a vector-ref invalidated all previously- checked globals for the current scope. Likewise, I would prefer to declare a procedure using vector-ref as pure, to let csc know that it does not

Re: (declare (pure ...))

2024-02-09 Thread siiky via
Hi Al, what does (declare (pure ..)) mean to csc? Is the function supposed to be * only side-effect free, or ... * also return the same value when called with the same arguments? I can't remember where `(declare)` is documented, but I believe this [0] is also relevant. [0]

Re: compiler types: records / collections interaction

2024-02-09 Thread siiky via
Hi Al, What combination of * define-record-type (srfi-9, srfi-99, chicken define-record, whatever) and * (declare type ...) can I use to inform the compiler that (for collections of myrec) vector- ref returns myrec's (likewise list car/cdr, hash-table-ref)? And that it needs not emit any

Re: compile-time deserialization

2023-12-26 Thread siiky via
Oh I forgot to mention you need an extra compiler flag to use it (-extend). And I also just remembered that I wrote a post about this at the time. (: https://siiky.srht.site/scheme/reader-syntax.html

Re: compile-time deserialization

2023-12-26 Thread siiky via
Hi, You can use reader syntax[0]. Take a look at this SQL reader syntax[1,2] I wrote some time ago for inspiration (it should require very little changing). [0] https://api.call-cc.org/5/doc/chicken/read-syntax/set-read-syntax%21 [1]