Re: [Chicken-announce] [ANN] CHICKEN 5.4.0 release candidate available

2024-06-01 Thread Kon Lovett
(sorry, forgot)

make PLATFORM=macosx PREFIX=/usr/local/chicken/5 C_COMPILER=/usr/bin/clang 
CXX_COMPILER=/usr/bin/clang++ CHICKEN=/usr/local/chicken/5/bin/chicken 
C_COMPILER_OPTIMIZATION_OPTIONS='-I/opt/local/include -I/usr/local/include -O3 
-fomit-frame-pointer -Wall -Wno-unused -Wno-uninitialized' 
LINKER_OPTIMIZATION_OPTIONS='-L/opt/local/lib -L/usr/local/lib' all

> On Jun 1, 2024, at 8:58 AM, Kon Lovett  wrote:
> 
> Operating system:
> Darwin Kyushu.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:09:52 
> PDT 2024; root:xnu-10063.121.3~5/RELEASE_X86_64 x86_64
> 
> Hardware platform:
> x86-64
> 
> C Compiler: 
> Apple clang version 15.0.0 (clang-1500.3.9.4)
> Target: x86_64-apple-darwin23.5.0
> Thread model: posix
> InstalledDir: 
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
> 
> Installation works?: yes
> 
> Tests work?: yes (w/ workaround for subshell DYLD_LIBRARY_PATH env var export 
> issue)
> 
> Installation of eggs works?: yes (srfi-29)
> 




Re: [Chicken-announce] [ANN] CHICKEN 5.4.0 release candidate available

2024-06-01 Thread Kon Lovett
Operating system:
Darwin Kyushu.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:09:52 
PDT 2024; root:xnu-10063.121.3~5/RELEASE_X86_64 x86_64

Hardware platform:
x86-64

C Compiler: 
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.5.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Installation works?: yes

Tests work?: yes (w/ workaround for subshell DYLD_LIBRARY_PATH env var export 
issue)

Installation of eggs works?: yes (srfi-29)




Re: compiler types: records / collections interaction

2024-02-09 Thread Kon Lovett



> On Feb 9, 2024, at 11:59 AM, Al  wrote:
> 
> Suppose I need a record of a record type myrec, and collections (vectors-of, 
> lists-of and hash-tables) with values myrec.

(define-type myrec (struct myrec))
(define-type myrec-vec (vector-of myrec))

(: myrv-ref (myrec-vec fixnum —> myrec)
(define myrv-ref vector-ref)

> 
> 
> 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 instance-type-checking code for objects extracted from such 
> collections?
> 
> 
> Furthermore, how can I see what the compiler thinks of a given identifier? 
> I've used 'csc -ot' but it only emits types for some identifiers. Maybe it 
> inlines others, I don't really know.
> 
> 
> Separately, how can I tell the compiler that fields in these records have 
> certain types? Add type declarations for the implicitly-defined per-field 
> accessors and mutators?

(import typed-records)
(define-record myrec (a : float) (b : symbol))

does this for you

(: make-myrec (float symbol -> (struct myrec)))
(: myrec? (* -> boolean : (struct myrec)))
(: myrec-a ((struct myrec) -> float))
(: myrec-b ((struct myrec) -> symbol))

> 
> 
> I've tried unwrapping collections of myrec, and also myrec fields, and it 
> seems to make a huge difference in the speed of compiled code. Presumably 
> because I don't know how to tell the compiler to omit type checking in "safe" 
> cases. I know I could use some of the more aggressive optimization levels, 
> but I don't really want to compile unsafe code everywhere, just where  I'm 
> using the correct types.
> 
> 
> Thanks,
> 
> Al
> 
> 




Re: Deprecated current-milliseconds

2023-12-06 Thread Kon Lovett



> On Dec 6, 2023, at 1:58 PM, Lassi Kortela  wrote:
> 
> Hi,
> 
> Version 5.3 csc gives the warning:
> 
> Use of deprecated identifier `current-milliseconds' from module 
> `chicken.time'.
> 
> for (at least) these modules:
> 
> * scheme.time (r7rs)
> * sendfile
> * srfi-18
> 
> Is there a drop-in replacement for this procedure?

chicken time current-process-milliseconds

> 
> -l
> 




Re: How to get help on commands

2023-08-24 Thread Kon Lovett
#613 $ chicken-doc scheme open-output-file

-- procedure: (open-output-file filename [mode ...])

Takes a string naming an output file to be created and returns an output port 
capable of writing characters to a new file by
that name. If the file cannot be opened, an error is signalled. If a file with 
the given name already exists, the effect is
unspecified.

Additional mode arguments can be passed in, which should be any of the keywords 
#:text, #:binary or #:append. #:text
and #:binary indicate the mode in which to open the file (this has an effect on 
non-UNIX platforms only), while #:append
indicates that instead of truncating the file on open, data written to it 
should be appended at the end. The extra mode
arguments are CHICKEN extensions to the R5RS standard.


> On Aug 24, 2023, at 9:55 AM, Lewis Levin  wrote:
> 
> After installing r7rs, ‘open-output-port’ is a more complete implementation 
> with this signature:
>  open-output-file name . mode
>   I need documentation for what is allowed in mode.  There is no functions 
> documentation anywhere for Chicken.  I don’t think is satisfactory to say 
> “Chicken is standard” as there is no standard.  A function may or may not be 
> provided.  The function if provided may or may not work as it does in any 
> other scheme.  Keyword arguments may or may not exist. Each implementation 
> may allow different optional arguments.





Re: Question about how to check a symbol is bound

2023-06-23 Thread Kon Lovett



> On Jun 22, 2023, at 9:07 PM, Pan Xie  wrote:
> 
> Hello
> 
> I am new to CHICKEN scheme and here is a (very) quick question of how to 
> check whether a symbol is bound.
> 
> I know it doable but I can't find the way.
> 
> I don't find the methods from the main CHICKEN manual document. Then I import 
> the "symbol-value-utils" module. I believe the "unbound?" or "symbol-value" 
> will do what I want, but to my surprise they does NOT:
> 
> I expect `symbol-value' will give me value of a symbol, but it will throw 
> exception for an
> undefined symbol, even I provide the default value:
> 
> (symbol-value foo #f)
> Error: unbound variable: foo

#;2> (symbol-value 'foo #f)
#f

(symbol-value foo #f) is asking for the symbol-value of the derefed variable 
`foo’

> 
> I expect (symbol-value (string->symbol "list")) will give me the list 
> procedure, but what I get is '#f'
> 
> (symbol-value (string->symbol "list"))
> #f

#;6> (symbol-value (string->symbol (string-append "scheme" "#" "list")))
#

> 
> I expect (unbound? foo) will return True value, but it just throw exception.

#;7> (unbound? ‘foo)
#t

#;9> (unbound? (string->symbol (string-append "scheme" "#" "list")))
#f

> 
> Does CHICKEN scheme provide facilities that make user check whether arbitrary 
> symbol is bound or get its value, just like the `boundp' or `symbol-value' in 
> Common Lisp?
> 
> Thanks
> Pan
> 
> 




Re: Problems with a program that uses SRFI-19 egg on Fedora 36 x86_64

2023-03-09 Thread Kon Lovett


> On Mar 8, 2023, at 7:39 PM, T. Kurt Bond  wrote:
> 
> I have a program that uses SRFI-19.  It works fine when compiled on macOS 
> using CHICKEN from brew.  However, when I compile it on Fedora 36 x86_64, 
> when run it issues the following errpr"
> 
> Error: (file-exists?) system error while trying to access file: 
> "/usr/share/chicken/srfi-29-bundles/en/us/utf-8/srfi-19"
> 
> Call history:
> 
> utf8-case-map.scm:50: utf8-lolevel#write-utf8-char  
> utf8-case-map.scm:224: loop  
> utf8-case-map.scm:222: utf8-lolevel#read-utf8-char  
> utf8-case-map.scm:223: char-downcase-locale  
> utf8-case-map.scm:215: char-downcase*  
> utf8-case-map.scm:143: char-map-multi-case  
> utf8-case-map.scm:117: loop  
> utf8-case-map.scm:117: loop  
> utf8-case-map.scm:117: loop  
> utf8-case-map.scm:117: loop  
> utf8-case-map.scm:117: loop  
> utf8-case-map.scm:117: loop  
> utf8-case-map.scm:117: loop  
> utf8-case-map.scm:144: char-downcase-single  
> utf8-case-map.scm:50: utf8-lolevel#write-utf8-char  
> utf8-case-map.scm:224: loop   <--
> 
> When I look, the file /usr/share/chicken/srfi-29-bundles/en/us/utf-8/srfi-19 
> does not exist. Indeed, the directory 
> /usr/share/chicken/srfi-29-bundles/en/us/utf-8 does not exist. Instead, it's 
> at /usr/share/chicken/srfi-29-bundles/en/srfi-19.  (Which is where the egg's 
> srfi-19.install.sh  installs it.)  And it is in 
> the same place on macOS, but I do not get this error there.
> 
> Any ideas? 

sorry, i do not know why the system error but path makes sense:

when there is something like “LANG=en_US.UTF-8” in the environment the bundle 
search begins at   “.../en/us/utf-8/srfi-19”, then “.../en/us/srfi-19”, & 
“.../en/srfi-19”; dropping specifiers in a most to least order. (i'm using 
macOS with the LANG setting)

> -- 
> T. Kurt Bond, tkurtb...@gmail.com , 
> https://tkurtbond.github.io 



Re: How does process-fork affect mailbox and threads

2022-09-22 Thread Kon Lovett



> On Sep 22, 2022, at 6:06 PM, Claude Marinier  wrote:
> 
> Allô,
> 
> I am considering a different approach for an old project which collects IP 
> traffic addresses and counters. The old approach has serious flaws: the PCAP 
> handler calls Scheme to process each packet without buffering and it forks at 
> regular intervals to write statistics.
> 
> In practice, the old approach consumed a lot of CPU time; it should be 
> unobtrusive. I am simplifying the data structures to avoid unnecessary memory 
> allocation and GC. The approach is not neat or tidy.
> 
> Using the mailbox egg should provide buffering; a thread can loop on 
> mailbox-receive! and accumulate the counts. On exit, the main can send a 
> message to the mailbox to stop the thread cleanly; the remaining data can 
> then be saved. 

the mailbox egg package has a srfi-18 reader-writer example in the tests 
directory ("chicken-install -r mailbox” to get the files )

but you should also see the gochan egg: http://wiki.call-cc.org/eggref/5/gochan

> 
> I have never used threads; this is intimidating. Here are some questions.
> 
> 1) The SRFI-18 egg has not reached version 1. Which threading egg do you 
> recommend for my simple case?

that one

> 
> 2) After calling process-fork, will the child still have an open PCAP handle? 
> Will the thread still be running? If the thread is running, the child process 
> could immediately ask it to stop and clean-up. If the thread is dead, it 
> could be messy. The child can wait for the thread to stop, right? The PCAP 
> loop will not be running when the main forks.
> 
> 3) The parent will need to reset the hash tables. Which is cleaner 
> hash-table-clear! or make-hash-table to start fresh (and let GC cleanup the 
> old one)? Which has less impact on performance?

-clear! is probably quicker in that some storage is reused (the k/v info gc is 
the same)

> 
> I am willing to read and experiment. I need to know where to start.
> 
> Merci.
> 
> P. S. I have asked many questions about other aspects of this before (years 
> ago) and the responses were excellent. Thank you.
> 
> -- 
> Claude Marinier




Re: After upgrade to 5.3.0 chickadee is broken

2021-12-24 Thread Kon Lovett
similar - https://bugs.call-cc.org/ticket/1721

> On Dec 24, 2021, at 8:49 AM, T. Kurt Bond  wrote:
> 
> Ok, I've figured out what went wrong, but I'm not sure why that happened.  
> Again, this is happening on macOS using homebrew to install CHICKEN Scheme 
> 5.3.0.  
> 
> The chickadee.install.sh  commands that create 
> .../share/chicken and copy the directory chickadee to it use 
> /usr/local/Cellar/chicken/5.3.0/usr/local/Cellar/chicken/5.3.0/share/chicken 
> instead of /usr/local/Cellar/chicken/5.3.0/share/chicken.  That is, it 
> repeats the /usr/local/Cellar/chicken/5.3.0/ part, so the files end up in the 
> wrong place.
> 
> Here are the commands from chickadee.install.sh 
> :
> 
> mkdir -p 
> "${DESTDIR}"'/usr/local/Cellar/chicken/5.3.0/usr/local/Cellar/chicken/5.3.0/share/chicken'
> cp -v -r '/Users/tkb/.cache/chicken-install/chickadee/chickadee' 
> "${DESTDIR}"'/usr/local/Cellar/chicken/5.3.0/usr/local/Cellar/chicken/5.3.0/share/chicken'
> 
> So, something is going wrong when chickadee.install.sh 
>  is generated.
> 
> I've added an issue in the chickadee github repository: 
> https://github.com/ursetto/chickadee/issues/1 
> 
> On Thu, Dec 23, 2021 at 12:30 PM T. Kurt Bond  > wrote:
> I'm using macOS with chicken from homebrew.
> 
> I installed chicken-doc and then chickadee, but now when I run "chickadee 
> serve" I get the following message:
> 
> $ chickadee  serve
> 
> Error: (change-directory) cannot change current directory - No such file or 
> directory: "/usr/local/Cellar/chicken/5.3.0/share/chicken/chickadee"
> 
> Call history:
> 
> spiffy.scm:548: chicken.condition#with-exception-handler
> spiffy.scm:548: ##sys#call-with-values
> spiffy.scm:548: scheme#eval
>   (let () (import openssl) ssl-port?)
>   (##core#let () (import openssl) ssl-port?)
> spiffy.scm:548: k691
> spiffy.scm:547: g694
> spiffy.scm:610: dynamic-import
> spiffy.scm:548: scheme#call-with-current-continuation
> spiffy.scm:548: chicken.condition#with-exception-handler
> spiffy.scm:548: ##sys#call-with-values
> spiffy.scm:548: scheme#eval
>   (let () (import openssl) ssl-port->tcp-port)
>   (##core#let () (import openssl) ssl-port->tcp-port)
> spiffy.scm:548: k691
> spiffy.scm:547: g694   <--
> 
> And, indeed, that directory is missing.  I've uninstalled chickadee and 
> installed it again, but that made no difference. 
> 
> Any idea of what is going wrong?
> -- 
> T. Kurt Bond, tkurtb...@gmail.com , 
> https://tkurtbond.github.io 
> 
> 
> -- 
> T. Kurt Bond, tkurtb...@gmail.com , 
> https://tkurtbond.github.io 



Re: Qt-light compile error

2021-12-04 Thread Kon Lovett
try removing the VERSION file

#! /usr/bin/env bash

EGG=${1:-taglib}

export CHICKEN_CSI=$(which csi)
CACHE_DIR=$HOME/.cache/chicken-install

chicken-install -retrieve $EGG
rm $CACHE_DIR/$EGG/VERSION
chicken-install -test $EGG

> On Dec 4, 2021, at 7:34 AM, Michael JH  wrote:
> 
> Hi:
> 
> I have a problem with compiling and installing qt-light under Mac OS X 
> Monterey.
> 
> The error message is:
> 
> In file included from qt-light.cpp:8:
> In file included from 
> /usr/local/Cellar/chicken/5.3.0/include/chicken/chicken.h:126:
> In file included from 
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:309:
> In file included from 
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:421:
> ./version:1:1: error: expected unqualified-id
> "1.0"
> ^
> In file included from qt-light.cpp:8:
> In file included from 
> /usr/local/Cellar/chicken/5.3.0/include/chicken/chicken.h:126:
> In file included from 
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/math.h:310:
> In file included from 
> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/limits:121:
> ./version:1:1: error: expected unqualified-id
> "1.0"
> ^
> 4 errors generated.
> make: *** [qt-light.o] Error 1
> 
> Error: (execute) shell command failed with non-zero exit status
> "make -f 'qt-light.make' clean all"
> 512
> 
> Any suggestions about how I could overcome this problem?
> 
> Thank you!
> 
> Michael



Re: Reository Path, FAQ, and Index Questions

2021-11-15 Thread Kon Lovett



> On Nov 15, 2021, at 6:06 AM, Christian Himpe 
>  wrote:
> 
> Hello,
> 
> I would like to ask how I can programmatically determine the system location 
> of eggs?

shell: chicken-install -repository

scheme: (import (chicken platform)) (repository-path)

> I ask because if I installed an egg to a user directory and I want to use the 
> system's eggs as well as the user egg, it seems I need to have the system's 
> and the user egg repository in the CHICKEN_REPOSITORY_PATH environment 
> variable. As the system's location may differ among operating systems, I 
> would like to determine this path from the command line and add it by script.
> 
> Also, is it possible that the "How can I install CHICKEN eggs to a 
> non-default location?" section of the "Frequently Asked Question":
> 
> http://wiki.call-cc.org/faq#how-can-i-install-chicken-eggs-to-a-non-default-location
> 
> is out of date? "chicken-install -init" and "(repository-path ...)" seem not 
> be available in CHICKEN Scheme 5.2, unless I am using it incorrectly.

that reads like CHICKEN 4 so out-of-date

> 
> Lastly, I would like to ask if CHICKEN Scheme has a function/symbol index, as 
> for example Chez Scheme has:
> 
> https://www.scheme.com/csug8/csug_1.html
> 
> and I just overlooked it?

the wiki manual has no index

chicken-doc can be useful here: chicken-doc -m remprop ;=> (chicken plist 
remprop!)  (remprop! SYMBOL PROPERTY)

(chicken-doc is an egg, though)

> 
> Thank You
> 
> Christian
> 




Re: message-digest-utils egg failing to install

2021-09-14 Thread Kon Lovett



> On Sep 14, 2021, at 4:38 PM, Jeff Moon  wrote:
> 
> Hi all,
> I have some automation that is building chicken fairly regularly with the 
> eggs that I need for one of my projects, and I noticed that about a week ago 
> it started failing while installing the message-digest-utils egg.  After a 
> bit of looking, it appears that it's trying to load a "message-digest-item" 
> module, which it's not finding.  I'm wondering if there's a missing egg and 
> if it may have a new dependency?  I can manually hang back on the older 
> version of the egg, but thought I'd let you know in case this is an easy fix.

sorry, message-digest-port was missing a dependency on message-digest-item, 
modules of the message-digest-utils egg

a new version is in the pipe

> Thanks,
> Jeff
> 




[ANN] faster message-digest

2021-09-08 Thread Kon Lovett
to anyone* using the message-digest “suite” the new release shows a decent 
speedup

of course this does nothing for the dependency bloat

* P{user(message-digest)} x [user] ~ 1 ;-)

-

macOS 11.5.2 w/ 3.2 GHz 6-Core Intel Core i7

csc md-v-simple.scm -Dfile -Dsimple -o simple-file
csc md-v-simple.scm -Dstring -Dsimple -o simple-string
csc md-v-simple.scm -Dfile -Dmd -o md-file
csc md-v-simple.scm -Dstring -Dmd -o md-string

#NOTE best of 3

./simple-file
Simple = 90bbbcbab37cde02d31e2955f1ab9e17becab506
1.959s CPU time, 4316/8 mutations (total/tracked), 0/2 GCs (major/minor), 
maximum live heap: 328.84 KiB

./md-file
MD = 90bbbcbab37cde02d31e2955f1ab9e17becab506
1.938s CPU time, 118/105 mutations (total/tracked), 0/1 GCs (major/minor), 
maximum live heap: 391.07 KiB

./simple-string
Simple = f6ac079150b45d4e7037f27b00ab9f74c9ecda55
0.045s CPU time, 431200/1621 mutations (total/tracked), 0/163 GCs 
(major/minor), maximum live heap: 331.16 KiB

./md-string
MD = f6ac079150b45d4e7037f27b00ab9f74c9ecda55
0.035s CPU time, 1136/213 mutations (total/tracked), 0/90 GCs (major/minor), 
maximum live heap: 391.31 KiB

cat >md-v-simple.scm Re: `utf8#string-length` hangs on eof octal



> On May 5, 2021, at 2:42 PM, Kon Lovett  wrote:
> 
> same behavior w/ C5

but

#;1> (import utf8)
#;2> (valid-string? "\377\354")
#f



> 
>> On May 5, 2021, at 2:20 PM, Henry Hu  wrote:
>> 
>> Hello CHICKEN users!
>> 
>> I'm using CHICKEN 4.13.0 from 2017 December.  When debugging why "send eof" 
>> caused our server to hang indefinitely, I found out that utf8's 
>> string-length was the culprit:
>> 
>> ```
>> $ csi
>> (use utf8)
>> (string-length "\377\354") ; line that was read from send eof
>> ;; hangs
>> ```
>> 
>> causes the interpreter to hang at least 30 seconds, probably indefinitely.  
>> I understand that this string isn't a valid UTF-8 codepoint, but does anyone 
>> have suggestions for what to do here?  (E.g., "Upgrade to CHICKEN 5" would 
>> be a nice answer.)
>> 
>> Some more results that make me think the \377 octal code in particular is 
>> culpable:
>> 
>> ```
>> #;4> (string-length "\354 a")
>> 1 ; OK, since \354 isn't a valid UTF-8 char
>> #;5> (string-length "\366 a")
>> 1
>> #;6> (string-length "\377 a")
>> ;; Hangs
>> ```
>> 
>> Thank you,
>> Henry
>> Infolab Group @ MIT
>> Cambridge, MA USA
> 



Re: `utf8#string-length` hangs on eof octal

same behavior w/ C5

> On May 5, 2021, at 2:20 PM, Henry Hu  wrote:
> 
> Hello CHICKEN users!
> 
> I'm using CHICKEN 4.13.0 from 2017 December.  When debugging why "send eof" 
> caused our server to hang indefinitely, I found out that utf8's string-length 
> was the culprit:
> 
> ```
> $ csi
> (use utf8)
> (string-length "\377\354") ; line that was read from send eof
> ;; hangs
> ```
> 
> causes the interpreter to hang at least 30 seconds, probably indefinitely.  I 
> understand that this string isn't a valid UTF-8 codepoint, but does anyone 
> have suggestions for what to do here?  (E.g., "Upgrade to CHICKEN 5" would be 
> a nice answer.)
> 
> Some more results that make me think the \377 octal code in particular is 
> culpable:
> 
> ```
> #;4> (string-length "\354 a")
> 1 ; OK, since \354 isn't a valid UTF-8 char
> #;5> (string-length "\366 a")
> 1
> #;6> (string-length "\377 a")
> ;; Hangs
> ```
> 
> Thank you,
> Henry
> Infolab Group @ MIT
> Cambridge, MA USA




Re: Orphan SRFI eggs and maintainership changes

srfis 27, 45, 111 & 195 (tbd)
 



Re: I ported the combinators egg to chicken 5

yes, please add to C5 (if you find it useful, maybe someone else ;-)

> On Dec 18, 2020, at 4:04 AM, Alaric Snell-Pym 
>  wrote:
> 
> Hi there Kon,
> 
> As I was porting something that needed it, I did a quick port of the 
> combinators egg to C5... I did it with cond-expand so the same codebase works 
> for C4 and C5 rather than making a new fork.
> 
> Please find it attached - if you like it it's all yours, and I'll gladly add 
> it to the C5 egg list if you wish :-)
> 
> Thanks for the eggs,
> 
> Alaric




Re: How to (eval ...) in a R7RS library?

(define-library (test-eval)
  (import
(scheme base)
(scheme eval)
;  \ / \ /
(only (scheme r5rs) scheme-report-environment))
  (export
my-eval)
  (begin
(define (my-eval)
  (eval '42 (scheme-report-environment 5)

> On Sep 10, 2020, at 12:26 PM, Lukas Böger  wrote:
> 
> Hi *,
> 
> I asked a question on stackoverflow (link below), but didn't get any answer 
> so far. If anyone knows how to deal with it, don't hesitate to let me know 
> (whether per mail or per SO answer).
> 
> Thanks,
> Lukas
> 
> https://stackoverflow.com/questions/63795556
> 




Re: 【Deployment】

appears using CHICKEN 5 but extras.c & data-structures.c are CHICKEN 4 modules

> On Aug 15, 2020, at 2:42 AM, Kristian Lein-Mathisen  
> wrote:
> 
> 
> Hi, 
> 
> I'm glad that helped. But I suppose I should have explained my process, 
> instead of just giving you the end result - which clearly doesn't work once 
> you start adding imports like you have.
> 
> The error messages you're seeing (undefined reference to `C_extras_toplevel') 
> are coming from your C compilier. They mean that your program is using a 
> function which isn't defined anywhere, so we need to find where 
> C_extras_toplevel is defined.
> 
> There are probably a hundred different ways of finding the .c file which 
> defines a function. Here's and one. Install ctags and then run this:
> 
>  ~/o/chicken-5.2.0rc1  ➤ ctags *.c
> # creates a "grepable" file called tags
> 
> ~/o/chicken-5.2.0rc1  ➤ grep C_extras_toplevel tags
> C_extras_toplevel   extras.c/^void C_ccall 
> C_extras_toplevel(C_word c,C_word *av){$/;"f   typeref:typename:void 
> C_ccall
> # so it seems we need extras.c too
> 
>  ~/o/chicken-5.2.0rc1  ➤ grep C_data_2dstructures_toplevel tags
> C_data_2dstructures_topleveldata-structures.c   /^void C_ccall 
> C_data_2dstructures_toplevel(C_word c,C_word *av){$/;"   f   
> typeref:typename:void C_ccall
> # and data-structures.c
> 
>  ~/o/chicken-5.2.0rc1  ➤ gcc -DHAVE_CHICKEN_CONFIG_H hello.c -I . runtime.c 
> library.c eval.c expand.c modules.c internal.c chicken-syntax.c 
> build-version.c extras.c data-structures.c -lm -llog -o hello
> 
> Adding those two files to the gcc command should get your program to compile 
> properly. If not, you can find the missing .c files by grepping `tags`. 
> 
> Hope that helps.
> K.
> 
> On Sat, Aug 15, 2020, 02:57 亀田馬志  > wrote:
> Hello.
> 
> >  gcc -DHAVE_CHICKEN_CONFIG_H hello.c -I . runtime.c library.c eval.c 
> > expand.c modules.c internal.c chicken-syntax.c build-version.c -lm -o hello
> 
> Oh, yes. It works! Great! Thank you!
> 
> But..
> 
> I wrote a script like this.
> 
> (import format (chicken io) (chicken string) (chicken process-context))
> 
> (require-extension srfi-13)
> 
> (let ((file-name (car (command-line-arguments
>   (with-input-from-file file-name
> (lambda ()
>   (let loop ((ls0 '()) (c (read-line)))
> (if (eof-object? c)
> (for-each (lambda (x)
> (format #t
> "時刻:~A秒,北緯:~A度~A分,東経:~A度~A分~%"
> (+ (* (cadar x) 60) (caddar x))
> (string-take (cadr x) 2)
> (string-drop (cadr x) 2)
> (string-take (caddr x) 3)
> (string-drop (caddr x) 3)))
>   (reverse ls0))
> (let ((ls1 (string-split c ",")))
>   (if (string=? (car ls1) "$GPGGA")
>   (loop (cons `(,(map string->number
>   (string-chop (list-ref ls1 1) 2))
> ,(list-ref ls1 2)
> ,(list-ref ls1 4)) ls0) (read-line))
>   (loop ls0 (read-line)
> 
> Sorry, some Japanese are mixed. But. Anyway.
> I try compiling with your way, and gcc gives me an error like this.
> 
> /usr/bin/ld: /tmp/ccxVWfZy.o: in function `f_223':
> poichan-01-1.c:(.text+0x765): undefined reference to `C_extras_toplevel'
> /usr/bin/ld: /tmp/ccxVWfZy.o: in function `f_226':
> poichan-01-1.c:(.text+0x92d): undefined reference to 
> `C_data_2dstructures_toplevel'
> collect2: error: ld returned 1 exit status
> 
> H Is there something wrong on the code?
> What are the C_extras_toplevel and C_data_wdstructures_toplevel?
> 
> If I used some libraries from chicken-install, should I use the compiled 
> "scheme to c" file too?
> 
> There must be something more to learn around the Chicken Scheme more.
> 
> Anyway, you have helped me a lot! Thank you.
> 
> 
> 2020年8月13日(木) 14:56 Kristian Lein-Mathisen  >:
> 
> Hi,
> 
> I managed to get something working on my termux, maybe that can help you:
> 
> ~/o/chicken-5.2.0rc1  ➤
> echo '(print "hello")' > hello.scm   ~/o/chicken-5.2.0rc1  ➤
> ./csc -t hello.scm
>  ~/o/chicken-5.2.0rc1  ➤
> gcc -DHAVE_CHICKEN_CONFIG_H hello.c -I . runtime.c library.c eval.c expand.c 
> modules.c internal.c chicken-syntax.c build-version.c -lm -llog -o hello
>  ~/o/chicken-5.2.0rc1  ➤ ldd hello 
> libm.so   
> liblog.so
> libdl.so
> libc.so
>  ~/o/chicken-5.2.0rc1  ➤ ./hello
> hello
> 
> You can ignore -llog unless you're on Android.
> 
> So you don't need buildtag.h. Is there a reason you can't "csc -static 
> hello.scm" or "csc -static -C -static hello.scm" which is a more common 
> use-case?
> 
> Cheers,
> K.
> 
> On Thu, Aug 13, 2020, 03:27 亀田馬志  

Re: srfi-19 for C5?

posix-utils should be available soon

> On Jan 15, 2020, at 7:20 AM, Sven Hartrumpf  wrote:
> 
> Hi all.
> 
> I found http://wiki.call-cc.org/eggref/5/srfi-19
> and assumed that SRFI-19 is supported by C5.
> But chicken-install fails because a dependency leads to posix-utils
> (and probably more eggs that are missing in C5).
> Is this analysis correct or is my cache broken?
> 
> Ciao
> Sven
> 




Re: [Chicken-users] How to use CHICKEN_apply function? Is there an example?

none that i know. but the general idea is

C_word args = C_list( … );
C_word proc = C_closure( … ); /* example after 
http://wiki.call-cc.org/man/5/C%20interface#c_closure 
 */
C_word result;
if (CHICKEN_apply( proc, args, &result )) {
/* do something with result */
} else {
char msg[ 1024 ];
CHICKEN_get_error_message( msg, sizeof msg );
/* do something with error msg */
}

do not want to speak for others but the feeling i get is that CHICKEN is 
considered a little heavy for embedding. there may not be a lot of experience.

btw, the source might help. CHICKEN_apply, for example, is defined in eval.scm.

> On Aug 29, 2019, at 6:21 PM, Aydar Zarifullin  wrote:
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Constants via define-constant



> On Jul 5, 2019, at 4:23 AM, Amir Teymuri  wrote:
> 
> Can someone explain what the difference between define and
> define-constant? I read the docs
> https://wiki.call-cc.org/man/5/Module%20(chicken%20base)#define-constant
> but i can't understand what its trying to say. Does define-constant
> defines constants when the program is compiled?

yes, define-constant is compile time only, & the defined name of the constant 
cannot be exported.

the interpreter treats define-constant as define.

when starting out w/ CHICKEN might be best to eschew define-constant & 
define-inline in favor of define

> 
> Many Thanks,
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Segmentation violation with chicken 5.1.0

C5.1 on macOS w/ clang also fails

> On Jun 22, 2019, at 8:50 AM, Sven Hartrumpf  wrote:
> 
> Hello.
> 
> I have a strange problem with legacy code that works in many
> other Schemes and Chicken 5 csi, but the binary compiled with Chicken 5 
> crashes.
> I have a reduced example: 
> http://sempria.de:9080/resources/chickenprob3.tar.bz2
> Just unpack and type make in the resulting directory.
> It shows "Error: segmentation violation" with gcc 8.3.0 and 9.1.0, 64 bit,
> Ubuntu 19.04.
> Interesting effect: the crash goes away if the input data structure is reduced
> after reading by passing a CLI argument smaller than 228,
> see makefile target 'check'.
> 
> Can anybody reproduce this segv?
> 
> Sven
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


chickenprob3.log
Description: Binary data
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] [Chicken-announce] [ANN] CHICKEN 5.1.0 release candidate available

Operating system: macOS 10.14.5 
Hardware platform: x86
C Compiler: clang 10.0.1
Installation works?: yes
Tests work?: yes
Installation of eggs works?: yes

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] more 'foreign' questions



> On Mar 27, 2019, at 12:14 PM, Christoph Lange  wrote:
> 
> i haven’t used the bind egg  but the documentation "General Operation” 
> section beginining with "Structure and union definitions …” seems relevant.
> 
> Haha, yes, thanks. Finding the relevant parts of the docs seems to be the 
> challenge in the beginning. Will read that.
> 
> it rolls access routines, ex: mosquitto_message-mid, 
> mosquitto_message-payload, ...
> 
> 
> #;1> (import bind)
> #;2> ,x* (bind* "struct mosquitto_message{
>   int mid;
>   char *topic;
>   void *payload;
>   int payloadlen;
>   int qos;
>   ___bool retain;
> };”)
> 
> Oh, useful tool to learn, as it seems.

the expand-full egg (only for macro debugging really)

> 
> Thanks for the help. ... one follow-up question:
> 
> I now get a void pointer to some data in memory, and the length of the 
> payload. How can I make that e.g. a blob? Or a string?

we’re trying to stop using string for non-char data so blob please ;-)

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] more 'foreign' questions

(gotta flight coming up so dashing but hth)

probably need to use the length for make-blob & then move-memory! from pointer 
to the alloc’ed blob

see (chicken memory)

> On Mar 27, 2019, at 12:14 PM, Christoph Lange  wrote:
> 
> i haven’t used the bind egg  but the documentation "General Operation” 
> section beginining with "Structure and union definitions …” seems relevant.
> 
> Haha, yes, thanks. Finding the relevant parts of the docs seems to be the 
> challenge in the beginning. Will read that.
> 
> it rolls access routines, ex: mosquitto_message-mid, 
> mosquitto_message-payload, ...
> 
> 
> #;1> (import bind)
> #;2> ,x* (bind* "struct mosquitto_message{
>   int mid;
>   char *topic;
>   void *payload;
>   int payloadlen;
>   int qos;
>   ___bool retain;
> };”)
> 
> Oh, useful tool to learn, as it seems.
> 
> Thanks for the help. ... one follow-up question:
> 
> I now get a void pointer to some data in memory, and the length of the 
> payload. How can I make that e.g. a blob? Or a string?


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] more 'foreign' questions

i haven’t used the bind egg  but the documentation "General Operation” section 
beginining with "Structure and union definitions …” seems relevant.

it rolls access routines, ex: mosquitto_message-mid, mosquitto_message-payload, 
...

#;1> (import bind)
; loading /usr/local/chicken/5/lib/chicken/10/bind.import.so ...
; loading /usr/local/chicken/5/lib/chicken/10/chicken.foreign.import.so ...
; loading /usr/local/chicken/5/lib/chicken/10/bind-translator.so ...
; loading /usr/local/chicken/5/lib/chicken/10/matchable.so ...
; loading /usr/local/chicken/5/lib/chicken/10/bind.so ...

#;2> ,x* (bind* "struct mosquitto_message{
  int mid;
  char *topic;
  void *payload;
  int payloadlen;
  int qos;
  ___bool retain;
};”)
(##core#begin
  (##core#declare
(foreign-declare
  "#define ___fixnum   int\n#define ___number   
double\n#define ___bool int\n#define ___byte 
char\n#define ___scheme_value C_word\n#define ___scheme_pointer   void 
*\n#define ___blob void *\n#define ___pointer_vector   void 
**\n#define ___symbol   char *\n#define ___safe\n#define ___declare(x, 
y)\n#define ___specialize\n#define ___abstract\n#define ___discard\n#define 
___in\n#define ___out\n#define ___inout\n#define ___mutable\n#define 
___length(var)\n#define ___pointer\n#define ___u32  C_u32\n#define 
___s32  C_s32\n#define ___u64  C_u64\n#define ___s64
  C_s64"
  "struct mosquitto_message{\n  int mid;\n  char *topic;\n  
void *payload;\n  int payloadlen;\n  int qos;\n 
 ___bool retain;\n};"
  "\n"))
  (##core#begin
(##core#begin
  (##core#ensure-toplevel-definition mosquitto_message-mid)
  (##core#set!
mosquitto_message-mid
(foreign-lambda*
  integer
  (((c-pointer (struct "mosquitto_message")) s))
  "return(s->mid);")))
(##core#begin
  (##core#ensure-toplevel-definition mosquitto_message-topic)
  (##core#set!
mosquitto_message-topic
(foreign-lambda*
  c-string
  (((c-pointer (struct "mosquitto_message")) s))
  "return(s->topic);")))
(##core#begin
  (##core#ensure-toplevel-definition mosquitto_message-payload)
  (##core#set!
mosquitto_message-payload
(foreign-lambda*
  (c-pointer void)
  (((c-pointer (struct "mosquitto_message")) s))
  "return(s->payload);")))
(##core#begin
  (##core#ensure-toplevel-definition mosquitto_message-payloadlen)
  (##core#set!
mosquitto_message-payloadlen
(foreign-lambda*
  integer
  (((c-pointer (struct "mosquitto_message")) s))
  "return(s->payloadlen);")))
(##core#begin
  (##core#ensure-toplevel-definition mosquitto_message-qos)
  (##core#set!
mosquitto_message-qos
(foreign-lambda*
  integer
  (((c-pointer (struct "mosquitto_message")) s))
  "return(s->qos);")))
(##core#begin
  (##core#ensure-toplevel-definition mosquitto_message-retain)
  (##core#set!
mosquitto_message-retain
(foreign-lambda*
  bool
  (((c-pointer (struct "mosquitto_message")) s))
  "return(s->retain);")))
(##core#begin
  (##core#ensure-toplevel-definition make-mosquitto_message)
  (##core#set!
make-mosquitto_message
(foreign-lambda*
  (c-pointer (struct "mosquitto_message"))
  ((integer mid)
   (c-string topic)
   ((c-pointer void) payload)
   (integer payloadlen)
   (integer qos)
   (bool retain))
  "struct mosquitto_message *tmp_ =  (struct mosquitto_message 
*)C_malloc(sizeof(struct mosquitto_message));\ntmp_->mid = mid;\ntmp_->topic = 
topic;\ntmp_->payload = payload;\ntmp_->payloadlen = payloadlen;\ntmp_->qos = 
qos;\ntmp_->retain = retain;\nreturn(tmp_);;\n")

> On Mar 27, 2019, at 8:06 AM, Christoph Lange  wrote:
> 
> After I now managed quite a lot of my interfacing to the mqtt library, I'm 
> stuck with the following:
> 
> I have the following definition of  a message struct, which I in fact get 
> back a pointer to, from a callback:
> 
> (bind* "struct mosquitto_message{
>   int mid;
>   char *topic;
>   void *payload;
>   int payloadlen;
>   int qos;
>   ___bool retain;
> };")
> 
> When I print what I get in Scheme it says something along the line of 
> #. Though the library frees the memory, it will -- 
> according to manual -- only do so after the callback returns. So within the 
> callback, I should be able to access / print it's content. Just how?! How do 
> I access the different fields in that struct? Especially the payload?
> 
> /Christoph
> ___
> Chicken-users mailing list
> Chicken-users

Re: [Chicken-users] string interpolation

yeah, it shouldn’t eval on the fly

unfortunately i cannot work on it until next week

sorry

> On Mar 25, 2019, at 2:30 PM, Phil Hofer  wrote:
> 
> Hi all,
> 
> I'm looking to perform string interpolation identically to
> the #<# multi-line reader macro, but for single-line strings.
> The string-utils package has set-sharp-string-interpolation-syntax
> and string-interpolate, which do almost exactly what I want, but
> the default interpolation only uses (interaction-environment),
> which keeps a function like this from working:
> 
> (define (print-with-foo x)
>   (display #"foo #{x}"))
> 
> Conversely, the following works, but doesn't scan as neatly to my eyes:
> 
> (define (print-with-foo x)
>   (display #<#EOF
> foo #{x}
> EOF
>   ))
> 
> I looked at setting the ENV parameter of string-interpolate,
> but the 'environments' module has disappeared from CHICKEN 5,
> so I can't even clumsily construct a string interpolation environment.
> 
> As a last resort, I could write my own reader macro, but I'd like
> to explore any existing solutions before heading down that route.
> (If someone on this mailing list is a read-syntax wizard and has a
> pithy solution in mind, share it!)
> 
> Advice greatly appreciated.
> 
> Cheers,
> Phil
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Timezone Handling in Chicken

i will not be able to fix this for a few days

> On Nov 28, 2018, at 12:53 PM, Jeff Moon  wrote:
> 
> If I run the following code under csi:
> (use posix locale)
> (locale-current#current-locale-components)
> It runs fine, and returns the expected info.  However, if I do the following:
> export TZ='America/Phoenix'
> And then re-run it, I get the following:
> 
> Error: (parse-posix-literal-timezone) bad timezone STD offset: 
> "America/Phoenix"
> 
> Call history:
> 
>   (##core#undefined)
>   (import scheme chicken (only posix 
> seconds->local-time) (only type-errors warning-argument-type) loc..
>   (##core#undefined)
>   (##core#undefined)
>   (##core#undefined)
>   (##core#undefined)
> (##sys#load-library (quote posix) #f)
> (##sys#require (quote locale))
> locale.scm:107: ##sys#require
> locale.scm:107: ##sys#require
> locale.scm:107: ##sys#require
> locale.scm:107: ##sys#require
> locale.scm:107: ##sys#require
> locale.scm:107: ##sys#require
>   (locale-current#current-locale-components)
> (locale-current#current-locale-components)<--
> 
> 
> The setting that I used for TZ is one of the options that is returned by the 
> tzselect command, so it should be valid.  
> Thanks,
> Jeff
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] directory-utils egg has dependency that appears to not exist



> On Apr 7, 2018, at 9:26 AM, Matt Welland  wrote:
> 
> Directory utils 1.1.0 depends on typed-define which does not appear to
> exist. If I install 1.0.6 it works.

sorry. try 1.1.1, when available..

> 
> Thanks.
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Memory allocation and limits in chicken scheme programs



> On Dec 13, 2017, at 4:16 PM, Matt Welland  wrote:
> 
> 
> 
> On Wed, Dec 13, 2017 at 12:41 PM, Peter Bex  > wrote:
> On Wed, Dec 13, 2017 at 11:13:54AM -0700, Matt Welland wrote:
> > I'm using Chicken 4.10.0 and with the below script chicken rapidly
> > allocates memory then seems to get stuck:
> 
> Hi Matt,
> 
> Try to update to CHICKEN 4.13.0 first (standard advice, we usually
> fix lots of issues in new versions).  I simply get this after a few
> seconds:
> 
> [panic] out of memory - heap has reached its maximum size - execution 
> terminated
> 
> The fix is to increase the maximum allowed heap size using -:hm:
> csi -:hm4G ./test.scm cleanly exits after a few seconds here with either
> version of CHICKEN.
> 
> > The program chokes after 133 rounds through the loop. No "out of memory'
> > message.
> 
> I suppose that's a bug we fixed in 4.13.0; I seem to recall an issue like
> that where allocating near the maximum heap size would result in it
> triggering a GC, then filling up the heap immediately again etc, resulting
> in a GC loop, but I can't find it in NEWS right now.

sounds familiar to me as well but looks like a such a note didn’t make it in

> 
> Much better with 4.13. Thanks. I have it working up to 128G. I don't 
> understand the heap and will do some more reading but am I correct in 
> assuming that the size of the heap will determine the largest data structure 
> I can have in memory?

umm, 2-space heap so ~64GB in your ex

> I base this on seeing the VIRT column in htop plateau at 128G when I used 
> -:nm128G. 
>  
> > The process memory usage doesn't seem to grow and the program just
> > hangs. I added -B: but didn't get any output.
> 
> Try the -:g option (debugging output for the GC); you'll quickly see that
> it's resizing the heap all the time to the same limit.
> 
> Cheers,
> Peter
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] [ANN] updated apropos : 2.5.0

looks like this now (sort by module is new):

#;1> ,a print qualified macros sort module
##sys#record-printersvariable
##sys#print-length-limit procedure args
##sys#print-to-stringprocedure (xs)
##sys#repl-print-hookprocedure (x port)
##sys#user-print-hookprocedure (x readable port)
print-error-message  procedure (ex . args)
print-call-chain procedure tmp
sprintf  procedure (fstr . args)
##sys#really-print-call-chainprocedure (port chain header)
##sys#print  procedure (x readable port)
printf   procedure (fstr . args)
print*   procedure args
char-set:printingvariable
##sys#register-record-printerprocedure (type proc)
printer: keyword
##sys#with-print-length-limitprocedure (limit thunk)
printprocedure args
##sys#repl-print-length-limitvariable
fprintf  procedure (port fstr . args)
pretty-print procedure (obj . opt)
flonum-print-precision   procedure tmp
pretty-print-width   procedure args
define-record-printermacro
max-symbol-printname-lengthsymbol-utils  procedure (syms)
symbol-printname-lengthsymbol-utils  procedure (sym)
symbol-printname-details   symbol-utils  procedure (sym)
symbol-printname=? symbol-utils  procedure (x y)
symbol-printname ,a '"w.*e" macros
eval-whenmacro
when macro
bitwise-and  procedure xs
bitwise-ior  procedure xs
bitwise-not  procedure (x)
bitwise-xor  procedure xs
call-with-current-continuation   procedure (proc)
call-with-input-file procedure (name p . mode)
call-with-output-fileprocedure (name p . mode)
call-with-values procedure C_call_with_values
char-downcaseprocedure (c)
char-lower-case? procedure (c)
char-whitespace? procedure (c)
drop-while   procedure (pred lis)
getter-with-setter   procedure (get set . tmp)
hash-table-weak-keys procedure (ht)
hash-table-weak-values   procedure (ht)
irregex-new-matches  procedure (irx)
keyword-styleprocedure args
newline  procedure tmp
software-typeprocedure ()
software-version procedure ()
string-downcase  procedure (s . maybe-start+end)
string-downcase! procedure (s . maybe-start+end)
take-while   procedure (pred lis)
take-while!  procedure (pred lis)
warning-argument-type   type-errors  procedure (loc obj typnam . tmp)
with-error-output-to-portprocedure (port thunk)
with-exception-handler   procedure (handler thunk)
with-input-from-file procedure (str thunk . mode)
with-output-to-file  procedure (str thunk . mode)
writeprocedure (x . tmp)
write-byte   procedure (byte . tmp)
write-char   procedure (c . tmp)
write-line   procedure (str . port)
write-string procedure (s . more)
char-set:lower-case  variable
char-set:whitespace  variable
#;1> (pp (apropos-information-list 'print))
(((||: . flonum-print-precision) procedure . tmp)
 ((||: . fprintf) procedure port fstr . args)
 ((symbol-utils . max-symbol-printname-length) procedure syms)
 ((||: . pretty-print) procedure obj . opt)
 ((||: . pretty-print-width) procedure . args)
 ((||: . print) procedure . args)
 ((||: . print*) procedure . args)
 ((||: . print-call-chain) procedure . tmp)
 ((||: . print-error-message) procedure ex . args)
 ((||: . printf) procedure fstr . args)
 ((||: . sprintf) procedure fstr . args)
 ((symbol-utils . symbol-printname-details) procedure sym)
 ((symbol-utils . symbol-printname-length) procedure sym)
 ((symbol-utils . symbol-printname___
Chicken

Re: [Chicken-users] Issues with latest message-digest egg


> On Oct 10, 2017, at 12:48 PM, Jeff Moon  wrote:
> 
> I have been using the "message-digest" egg.  It was working for me for quite 
> a while.  I recently recompiled and installed chicken 4.10.0, and noticed 
> that it was having issues.  
> If I do the following code:
> (use message-digest md5)
> (message-digest-string (md5-primitive) "abcdefgh")
> I get: 
> /tmp/chicken-4.10.0/bin/csi: symbol lookup error: 
> /tmp/chicken-4.10.0//lib/chicken/7/message-digest-support.so: undefined 
> symbol: f_336
> If I force the egg to downgrade to version 3.1.0, the same code outputs:
> "e8dc4081b13434b45189a720b77b6818"
> Does anybody know what has changed in this egg, or if there is a way to get 
> around this error on the new version of the egg?  I would like to be on the 
> latest version of the egg to avoid the need to lock to an older version.

I have not looked into the cause of this but i use CHICKEN 4.12.1 (& that w/ my 
own patches). Something i did works w/ the new compiler but not the old.

my suggestion is to take the latest egg & change every place it says "#:inline? 
#t” to “#:inline? #f” in message-digest.setup. (emit-inline-file can have 
problematic results)

> Thanks,
> Jeff
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Printing Problem


> On Jul 14, 2017, at 11:46 AM, Daniel I Hong  wrote:
> 
> Hi all,
> 
> I just recently began using Chicken, and I ran into a problem when trying to 
> write something to a file. Is there any function identical to 'write' from 
> from the 'extras' unit, except it prints literal newlines (like how 'display' 
> prints newlines) instead of '\n'? Or is there an easy way around this? Any 
> help would be much appreciated. Thanks!


See

http://wiki.call-cc.org/man/4/Unit%20library#standard-inputoutput 


http://wiki.call-cc.org/man/4/Unit%20extras#formatted-output 


the print & printf procedures have, or can perform, like display.

BTW, write is part of R5RS (& earlier & later). You are probably thinking of 
one of the ‘write-…’ procedures from extras

> 
> Best,
> Daniel
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org 
> https://lists.nongnu.org/mailman/listinfo/chicken-users 
> 
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] strange behavior with SRFI-19 date arithmetic


> On Mar 4, 2017, at 11:29 AM, Todd Roth  wrote:
> 
> When using the date arithmetic functions in srfi-19 I’m getting incorrect 
> results when specifying ‘days or any smaller DATE-KEY parameter. The ‘year 
> DATE-KEY returns the correct date/time.  Below is an example from a repl 
> session.  I’m seeing the same behavior when using the date-add-duration and 
> date-subtract-duration functions.  Has anyone else seen this?
> 
> 
> #;101> (time->date (current-time))
> #,(date 767000 56 10 14 4 3 2017 -18000 EST #f #f #f #f)
> 
> #;110> (date-adjust (time->date (current-time)) 1 'years)
> #,(date 226000 56 11 14 4 3 2018 -18000 EST #f #f #f #f)
> 
> #;152> (date-adjust (time->date (current-time)) 1 'days)
> #,(date 0 53 58 19 9 6 2047 -18000 EST #f #f #f #f)

Sorry, my fault. Hopefully all better now:

#;2> (define t1 (time->date (current-time)))
#;3> t1
#,(date 68900 48 37 12 4 3 2017 -28800 PST #f #f #f #f)

#;4> (date-adjust t1 1 'days) 
#,(date 68900 48 37 12 5 3 2017 -28800 PST #f #f #f #f)

version 3.4.1 should be available in a few hours.

> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] mathh failure with csc -optimize-level 3


> On Jan 15, 2017, at 4:12 AM, Peter Bex  wrote:
> 
> On Sat, Jan 14, 2017 at 10:17:14PM -0500, Robert Altenburg wrote:
>> Is this a bug that others can replicate? Any idea what's going on?
> 
> Hello Robert,
> 
> This looks like either a bug in the "mathh" egg, or a bug in
> CHICKEN that's triggered by the mathh egg.
> 
> The .inline file that mathh installs contains this code:
> 
> (mathh#gamma
>  (##core#lambda
>(f_684 #t (k685 double176179) 12)
>(let (g178180)
>  (##core#inline_allocate ("C_a_i_bytevector" 6) '(4))
>  (let (r688)
>(##core#inline
>  ("C_i_foreign_flonum_argumentp")
>  (##core#variable (double176179)))
>(##core#call
>  (#t)
>  (##core#variable (k685))
>  (##core#inline
>(stub177)
>(##core#variable (g178180))
>(##core#variable (r688
> 
> But the stub isn't defined anywhere.  Maybe Kon (the egg's maintainer)
> can shed some light on how this is supposed to work?

Yes, I wondered about stub177. Here is the scheme call & mathh definition:

(use mathh)

(define (factorial x)
(gamma (+ 1 x)) )

(factorial 9) 

---

(define gamma
(cond-expand
(windows (lambda-unimplemented 'gamma) )
(linux (foreign-lambda double "tgamma" double) )
(macosx (foreign-lambda double "tgamma" double) )
(else (foreign-lambda double "gamma" double) ) ) ) 

Um, not my stub. At least not explicitly.

> 
> Cheers,
> Peter


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] set! on unbound variable


> On Sep 23, 2016, at 6:31 PM, Dan Leslie  wrote:
> 
> Sounds like a Chicken Bug,

Chicken calls this a “convenience”. Yes, a std violation but handy using a REPL.

Should be able to defeat.

> from the docs[‎0]:
> 
> >  is evaluated, and the resulting value is stored in the 
> > location to which  is bound.  must be bound either in 
> > some region enclosing the set! expression or at top level. The result of 
> > the set! expression is unspecified.
> 
> 0: https://wiki.call-cc.org/man/4/The%20R5RS%20standard#assignments
> 
> -Dan
> 
> Sent from my BlackBerry 10 smartphone.
> From: Jinsong Liang
> Sent: Friday, September 23, 2016 6:27 PM
> To: chicken chicken
> Subject: [Chicken-users] set! on unbound variable
> 
> Hi,
> 
> I have been tripped by the following mistake a few times:
> 
> (let ((hello 0))
> (set! helo 1))
> 
> I meant to set! on hello. However, due to a typo, I did set! on helo. This 
> bug is extremely hard to debug to me. Is there a way to make Chicken give 
> warning on this? Or how do you handle this issue?
> 
> I know probably using set! is not a good programming style. I found that in 
> some situations it is hard to avoid set!.
> 
> Thank you!
> 
> Jinsong
>
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Having trouble statically compiling code


> On Sep 1, 2016, at 10:57 AM, Peter Bex  wrote:
> 
> On Thu, Sep 01, 2016 at 10:52:42AM -0700, Kon Lovett wrote:
>>> Kon, if you're reading this: It would be nice if setup-helper could
>>> detect this deprecated usage and simply error. 
> 
> I think it doesn't even need to do that; it can simply forego installing
> the .scm source file, and only install the compiled objects.  That way,
> any attempt to (include) it will simply fail.

Yes. Just another module dep that happens to be used at install time.

> 
> Cheers,
> Peter


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Having trouble statically compiling code


> On Aug 31, 2016, at 11:44 PM, Peter Bex  wrote:
> 
> On Thu, Sep 01, 2016 at 02:03:26AM +0100, stugol wrote:
>>   Hi Peter,
>> 
>>   We're close, but not quite there yet:
>> 
>> Error: (require) cannot load extension: setup-api
>>Call history:
>>intarweb.scm:577: irregex
>>intarweb.scm:612: list
>>intarweb.scm:612: make-parameter
>>intarweb.scm:630: make-parameter
>>intarweb.scm:718: list
>>intarweb.scm:718: make-parameter
>>intarweb.scm:743: list
>>intarweb.scm:743: list
>>intarweb.scm:790: make-parameter
>>intarweb.scm:885: list
>>intarweb.scm:885: make-parameter
>>intarweb.scm:911: irregex
>>intarweb.scm:934: irregex
>>intarweb.scm:967: list
>>intarweb.scm:967: make-parameter
>>setup-helper.scm:12: ##sys#require<--
>> 
>>   I tried artificially adding 'setup-api' as a dependency to 'intarweb',
>>   but it's not a real package and so can't be linked.
> 
> It looks like something intarweb depends on is (include)ing setup-helper.
> That egg is a constant source of trouble, especially when people use the
> deprecated way of using it, through (include).  You'd have to grep the
> sources and find the culprit, then report a bug to the respective egg's
> author.
> 
> Kon, if you're reading this: It would be nice if setup-helper could
> detect this deprecated usage and simply error.  That would temporarily
> break some eggs, but at least it would help us find the broken ones.
> In the long run, this will save everyone a world of grief (this causes
> issues with cross-compilation, static compilation, deploy mode and
> alternative repository paths in general).

You are right. It has long been time to act on the, 4 yr (?), deprecation. I 
will release a new version soon.

> 
> Cheers,
> Peter
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] ARM web sockets extension compile error


> On Sep 1, 2016, at 7:40 AM, Jarrod Bourlon  wrote:
> 
> I am trying to compile the websockets extension for ARM using the typical 
> ‘arm-linux-gnueabi-gcc’ cross-compilation method by generating a special 
> cross-compilation Chicken as described here: 
> https://wiki.call-cc.org/man/4/Cross%20development
> 
> My dev environment looks good; I’ve compiled several extensions using my 
> Chicken cross compiler.  However, when compiling the websockets extension, I 
> get an error while trying to compile the dependency ‘mailbox’.  Is mailbox 
> supported on ARM, or am I missing some dependency?

inline-type-checks.scm is a part of the check-errors egg, which is a mailbox 
egg dependency. The install attempts to place a copy in the Chicken Home 
directory but can fail with this warning:

cannot copy to Chicken Home: must use CHICKEN_INCLUDE_PATH when using 
"inline-type-checks"

Suspect you need to have the environment variable CHICKEN_INCLUDE_PATH at least 
state the 'repository-path’, ex:

CHICKEN_INCLUDE_PATH=/usr/local/lib/chicken/8;/usr/local/share/chicken

The mailbox egg impl is designed for an older Chicken. The shortcuts taken are 
not needed, or wanted, now. I need to do some re-writing.

> 
> 
> 
> Here is the output when trying to install mailbox:
> 
> 
> websockets# arm-chicken-install mailbox   
> retrieving ...
> connecting to host "chicken.kitten-technologies.co.uk", port 80 ...
> requesting "/henrietta.cgi?name=mailbox&mode=default" ...
> reading response ...
> HTTP/1.1 200 OK
> Date: Thu, 01 Sep 2016 14:38:48 GMT
> Server: Apache/2.2.31 (Unix) DAV/2 PHP/5.5.36 mod_fastcgi/2.4.6
> Connection: close
> Transfer-Encoding: chunked
> Content-Type: text/plain
> reading chunks 
> reading files ...
>  ./mailbox.meta
>  ./chicken-primitive-object-inlines.scm
>  ./chicken-thread-object-inlines.scm
>  ./inline-queue.scm
>  ./mailbox.scm
>  ./mailbox.setup
> mailbox located at /tmp/temp7739.29453/mailbox
> checking platform for `mailbox' ...
> checking dependencies for `mailbox' ...
> install order:
> ("mailbox")
> installing mailbox:2.1.5 ...
> copying sources for target installation
>  cp -r /tmp/temp7739.29453/mailbox/* /tmp/temp464.29453
> changing current directory to /tmp/temp7739.29453/mailbox
> deleting stale binaries ...deleting stale binaries ...
>  '/cross-chicken/bin/arm-csi' -bnq -setup-mode -e "(require-library 
> setup-api)" -e "(import setup-api)" -e "(setup-error-handling)" -e 
> "(extension-name-and-version '(\"mailbox\" \"2.1.5\"))" -e "(host-extension 
> #t)" 'mailbox.setup'
>  '/cross-chicken/bin/arm-csc' -feature compiling-extension -setup-mode  -host 
>  mailbox.scm -shared -optimize-leaf-routines -inline -output-file mailbox.so 
> -emit-import-library mailbox -scrutinize -feature unsafe-operations 
> -optimize-level 3 -debug-level 1 -no-procedure-checks -no-bound-checks 
> -no-argc-checks
> 
> Error: (open-input-file) cannot open file - No such file or directory: 
> "inline-type-checks"
> 
>   Call history:
> 
> (define-inline (%condition-variable-waiters-empty? 
> cv) (%null? (%condition-variable-waiters cv)))
> (##core#define-inline 
> %condition-variable-waiters-empty? (##core#lambda (cv) (%null? 
> (%condition-var...
> (define-inline (%condition-variable-waiters-empty! 
> cv) (%structure-set!/immediate cv 2 (quote (
> (##core#define-inline 
> %condition-variable-waiters-empty! (##core#lambda (cv) 
> (%structure-set!/immedi...
> (define-inline (%condition-variable-waiters-add! cv 
> th) (%condition-variable-waiters-set! cv (%appen...
> (##core#define-inline 
> %condition-variable-waiters-add! (##core#lambda (cv th) 
> (%condition-variable-w...
> (define-inline (%condition-variable-waiters-delete! 
> cv th) (%condition-variable-waiters-set! cv (%de...
> (##core#define-inline 
> %condition-variable-waiters-delete! (##core#lambda (cv th) 
> (%condition-variabl...
> (define-inline (%condition-variable-waiters-pop! mx) 
> (let* ((wt (%condition-variable-waiters mx)) (t...
> (##core#define-inline 
> %condition-variable-waiters-pop! (##core#lambda (mx) (let* ((wt 
> (%condition-va...
> (define-inline (%condition-variable-specific cv) 
> (%structure-ref cv 3))
> (##core#define-inline %condition-variable-specific 
> (##core#lambda (cv) (%structure-ref cv 3)))
> (define-inline (%condition-variable-specific-set! cv 
> x) (%structure-set!/mutate cv 3 x))
> (##core#define-inline 
> %condition-variable-specific-set! (##core#lambda (cv x) 
> (%structure-set!/mutat...
> (include "inline-type-checks")
> (##core#include "inline-type-checks") <--
> 
> Error: shell command terminated with non-zero exit status 17920: 
> '/cross-chicken/bin/arm-chicken' 'mailbox.scm' -output-file 'mailbox.c' 
> -dynamic -feature chicken

Re: [Chicken-users] [ANN] New egg: color - a port of Aubrey Jaffer's SLIB color module


> On Apr 29, 2016, at 10:10 PM, Erik Falor  wrote:
> 
> On Fri, Apr 29, 2016 at 05:32:48PM +, Alex Charlton wrote:
>>   This is awesome! I was just about to play with some colour related
>>   stuff and I was feeling sad that I didn't have easy access to different
>>   colour spaces. I'm going to use this right now!
>>   Thanks, Erik!
> 
> That's what I call good timing!
> 
> Depending on what you are trying to accomplish, this library might be
> just a bit too low-level. Aubrey's color library showed me that there
> was a lot more to color than I had realized! I found that this library
> came with quite a learning curve. As a result I now better understand
> how our eyes and brains give us vision, but feel that a less academic
> API would be more readily useful to more users.
> 
> For instance, I was interested in converting colors specified as RGB
> triplets into HSV where it's really easy to adjust the hue while
> preserving the brightness. I found that I could do that with the L*C*h
> color space. L*C*h is similar to HSV in concept, but differs in that
> it's based upon human perception instead of the capabilities of
> display hardware. Therefore it will give somewhat different results
> than one may expect.
> 
> If that sounds like the sort of thing you want to do, you may want to
> take a look at the color-example.scm program included with the egg. It
> contains a bunch of functions to more easily do those sorts of color
> manipulations: e.g. computing color harmonies, scaling the chroma or
> lightness of colors, etc. 
> 
> As I believe those things are what most users would like to be able to
> do, I may release an ezcolor egg that wraps the color egg and exposes
> those functions.
> 
> What do you folks think?

FWIW, when updating the amb egg I added helper macros/functions used by 
examples as exports from a new module, “amb-extras”, You may need to edit the 
color examples for generality but very much suggest the product is useful.

> 
> -- 
> Erik Falor
> Registered Linux User #445632http://unnovative.net
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] ANN: [geiser] Version 0.8


> On Oct 12, 2015, at 8:39 AM, Dan Leslie  wrote:
> 
> 
> A great many bugs in the Chicken Scheme support have been addressed;
> many thanks to the users who reported issues!
> 
> Also, completions are, on average, much faster for REPLs with very large
> environments. It could be faster, but it would require modifying the
> apropos egg to bypass the use of regular expressions, it seems.

I was unaware ‘apropos’ was a bottleneck.

So you want an API (& I assume csi command extension) to state literal 
interpretation of the string, rather than as a pattern.

> 
> Enjoy! And please do keep filing issues.
> 
> -Dan
> 
> jao  writes:
> 
>> Improved features:
>> 
>>  - Lots of improvements to Chicken support, by Dan Leslie.
>>  - Better interoperability with xscheme.
>>  - Much better performance for long lists of completions or
>>evaluated values.
>>  - Better highlighting and indentation rules, by Alex Kost and Dan
>>Leslie.
>>  - Make completion work for quoted symbols.
>> 
>> Bug fixes:
>> 
>>  - geiser-connect-local working again.
>> 
>> 
>> ---
>> View it on GitHub:
>> https://github.com/jaor/geiser/releases/tag/0.8
> 
> -- 
> -Dan Leslie
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] sequential version of set!


> On Aug 12, 2015, at 4:50 AM, Alexej Magura  wrote:
> 
> Is there a sequential version of set!, as in setq?

See http://wiki.call-cc.org/eggref/4/moremacros#stiff-set

> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] u8vector to numbers bignum


> On May 27, 2015, at 3:53 PM, chi  wrote:
> 
> How would I convert a u8vector to a bignum?
> 
> I'd like a good large random number, and there's srfi 27 for decent random
> sources, and there's 'numbers' for bignum support, but srfi-27 only produces
> fixnums or u8vectors.

The integer result range extends to that of the limit parameter. Ex:

#;1> (use numbers srfi-27)
; loading /usr/local/lib/chicken/7/numbers.import.so ...
; loading /usr/local/lib/chicken/7/srfi-27.import.so ...
; loading /usr/local/lib/chicken/7/srfi-4.import.so …
...
; loading /usr/local/lib/chicken/7/srfi-4-checks.so ...
; loading /usr/local/lib/chicken/7/srfi-4-errors.so ..
#;2> (random-integer (expt 2 64))
15816285179193592418
#;3> (bignum? 15816285179193592418)
#t

> Logically I can't imagine a bignum isn't represented under
> the hood by a block of bytes somehow, so it should be easy to turn a random 
> byte
> vector into a random bignum?
> 
> numbers itself only provides (random ...) which uses rand(3), and that's not
> what I would call a good random number. Random sources don't really seem like
> something a bignum library should worry about, anyway.
> 
> I could always do (number->string (u8vec_to_hex (random-u8vector #x20)) #x10)
> but having a double sized hexadecimal intermediate isn't terribly appealing,
> especially for a random number I might have to generate for hundreds of peers 
> a
> second in a high volume scenario. (Okay now I really /am/ being optimistic.)
> 
> Looking at the numbers source, it seems to be analagous to a vector whose 
> first
> element is a magic number indicating it's a bignum, and the rest of the vector
> is the digits. I'm not qualified to say how hard that would be to turn a 
> vector
> into that, but it really doesn't seem like it would be too much trouble for
> someone who was. Of course it would be seen as native endian, but since it's a
> random number it doesn't matter too much.
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] do* implementation


> On Apr 28, 2015, at 11:35 AM, Alexej Magura  wrote:
> 
> 
> Message: 5
> Date: Tue, 28 Apr 2015 10:15:28 +0200
> From: Christian Kellermann 
> 
>> 
>> Message: 5
>> Date: Tue, 28 Apr 2015 10:15:28 +0200
>> From: Christian Kellermann 
>> 
>> 
>> To: 
>> chicken-users@nongnu.org
>> 
>> Subject: Re: [Chicken-users] do* implementation
>> Message-ID: 
>> <87iocgllcv@devpool08.emlix.com>
>> 
>> Content-Type: text/plain
>> 
>> Alexej Magura 
>> 
>>  writes:
>> 
>>> I thought about writing my own, but I'm a bit rusty with scheme atm
>>> and I couldn't figure out where 
>>> /do/
>>>  is defined in Chicken's source
>>> code, so I don't think I'd be able to implement it efficiently.
>>> 
>> It's defined in expand.scm:1261 in CHICKEN core, as it's syntax. 
>> 

Suspect you will need to write your own. The definition at expand.scm:1261 is 
for the ‘do’ form:

(do ((a '(1 2 3 4 5) (cdr a))
  (b (car a) (car a)))
 ((eq '() a))
 (print b))

=>

(##core#app
  (##core#letrec*
((doloop
   (##core#loop-lambda
 (a b)
 (##core#if
   (eq (##core#quote ()) a)
   (##core#undefined)
   (##core#begin
 (##core#let () (print b))
 (##core#app doloop (cdr a) (car a)))
doloop)
  (##core#quote (1 2 3 4 5))
  (car a))

>> 
>> HTH,
>> 
>> Christian
>> 
>> 
>> -- 
>> May you be peaceful, may you live in safety, may you be free from
>> suffering, and may you live with ease.
>> 
>> 
>> 
>> 
>> --
>> 
>> ___
>> Chicken-users mailing list
>> 
>> Chicken-users@nongnu.org
>> https://lists.nongnu.org/mailman/listinfo/chicken-users
> 
> Oh, guess grep must have missed it somehow... anyway, thanks, Christian.
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] RecordType operations and parameter types


> On Jan 6, 2015, at 4:16 AM, Bahman Movaqar  wrote:
> 
> I have a record type, SOME-RT, and am implementing operations for it. As a 
> habit, I keep putting an 'assert' expression at the beginning of each 
> procedure.
> 
>   (define (some-rt-some-op param1)
> (assert (some-rt? param1) ...)
> 
> However, I doubt if I'm doing things the idiomatic way. Is this the approach 
> you seasoned CHICKEN'ers would take as well? TIA,

Yet another style using the http://wiki.call-cc.org/eggref/4/check-errors 
 egg:

(use type-checks)

; creates ‘check-some-rt’ & ‘error-some-rt’ functions
; see documentation for options
(define-check+error-type some-rt)

 (define (some-rt-some-op param1)
(check-some-rt ‘some-rt-some-op param1 ‘param1)
...)

;check fail will signal a SRFI 12 composite condition (exn type) with 
properties location=some-rt-some-op, arguments=(), & 
message=“bad param1 argument - not a some-rt”. The argument identifier is 
optional.
> -- 
> Bahman Movaqar
> 
> http://BahmanM.com  - https://twitter.com/bahman__m 
> 
> https://github.com/bahmanm  - 
> https://gist.github.com/bahmanm 
> PGP Key ID: 0x6AB5BD68 (keyserver2.pgp.com)
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] testing if a symbol has been interned


> On Dec 19, 2014, at 10:38 PM, Alexej Magura  wrote:
> 
> In Common Lisp, clisp specifically, you can test whether a symbol has been 
> bound, that is interned, or not using boundp; is there a way to do this in 
> Chicken?
> 
> (boundp 'a) ; nil
> (defvar a 1)
> (boundp 'a) ; t
> 
> I wrote up a function once a while back that used exception handling to check 
> if a symbol had been defined, but if there's already an egg that provides 
> this support or if it's built-in, I wanted to know so that I wouldn't have to 
> bother trying to rewrite said function.

Look at the symbol-utils egg unbound-value unbound-value? unbound?

#;1> (use symbol-utils)
#;2>  (unbound? 'foo)
#t
#;3> (unbound? '+)
#f

>  -- 
> Alexej Magura
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] How to pass a list to amb?


On Aug 24, 2014, at 12:48 PM, Sascha Ziemann  wrote:

> I tried to pass a list to amb but I do not know how to use amb-thunks. I 
> tried this:
> 
> (require-extension amb)
> 
> (let ((names '(a b c)))
>   (amb-collect
>(let ((name (amb-thunks (map (lambda (x) x) names)))

(name (amb-thunks (map (lambda (x) (lambda () x)) names)))

>  (value (amb 'c 'b 'a)))
>  (amb-assert (eq? name value))
>  value)))
> 
> (let ((names '(a b c)))
>   (amb-collect
>(let ((name (amb-thunks names))
>  (value (amb 'c 'b 'a)))
>  (amb-assert (eq? name value))
>  value)))
> 
> But both failes with:
> 
> Process scheme exited abnormally with code 139
> 
> This looks like a bug to me.

Yes, it should not segv but your argument for amb-thunks is invalid. Must be a 
list of thunks.

#;2> ,x (amb 'c 'b 'a)
(amb-thunks (list (lambda () 'c) (lambda () 'b) (lambda () 'a)))

> 
> I have tested with 4.7.0 on Debian (Intel 32).
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] bug in functor implementation


On Aug 14, 2014, at 11:01 AM, Oleg Kolosov  wrote:

> On 08/13/14 15:37, Juergen Lorenz wrote:
>> Hi all,
>> 
>> I've found a bug in the functor implementation.
>> Consider the following trivial example
>> 
> 
> Hello, sorry for off-topic question, I'm assuming that you are using
> these. Can you give some real world example? I've thought that functors
> are pretty obscure feature that nobody is using.

The levenshtein egg uses functors.

> 
> -- 
> Regards, Oleg
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Install error on variable-item - custom repository

(Forgot to CC the group)

On Jun 6, 2014, at 10:26 AM, maresp  wrote:

> Hi,
> 
> when I try to install srfi-19 with a custom repository location, 
> chicken-install halts when installing variable-item with the following error

Sorry you are having trouble installing. Please try variable-item version 
1.3.1. New versions usually available in a couple hours after upload.

chicken-install -test  variable-item:1.3.1

> 
> installing variable-item:1.3.0 ...
> changing current directory to /tmp/temp48fe.20325/variable-item
> '/usr/bin/csi' -bnq -setup-mode -e "(require-library setup-api)" -e "(import 
> setup-api)" -e "(setup-error-handling)" -e "(extension-name-and-version 
> '(\"variable-item\" \"1.3.0\"))" 
> '/tmp/temp48fe.20325/variable-item/variable-item.setup'
> 
> Error: (open-input-file) cannot open file - No such file or directory: 
> "setup-helper"
> 
> 
> Error: shell command terminated with nonzero exit code
> 17920
> "'/usr/bin/csi' -bnq -setup-mode -e \"(require-library setup-api)\" -e 
> \"(import...
> 
> This is not the case if I install spfi-19 or variable-item as root in 
> /usr/lib64/chicken/6 
> 
> My current env looks like that
> 
> $ echo $CHICKEN_REPOSITORY
> /home/maresp/tt/.chicken/lib/chicken/6
> $ echo $CHICKEN_INSTALL_PREFIX
> /home/maresp/tt/.chicken/bin
> 
> I'm very new to scheme and chicken, so just let me know if more info is 
> needed.
> 
> Markus
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] CHICKEN 4.9.0rc1 is available


On Apr 18, 2014, at 8:13 AM, Mario Domenech Goulart  
wrote:

> Hi Daniel,
> 
> On Fri, 18 Apr 2014 08:08:57 -0700 Daniel Leslie  wrote:
> 
>> Could we get the following C functions exposed to scheme?
>> 
>> C_find_symbol_table
>> C_enumerate_symbols
>> 
>> Unless I'm mistaken, there's no way to access symbol table information
>> from scheme at the moment; these two in particular would make tag
>> completion in my emacs config far, far superior.
> 
> Wouldn't something like
> http://call-with-hopeless-continuation.blogspot.com.br/2009/12/introspeccao-de-modulos-em-chicken.html
> do the trick?

The apropos egg also searches the environment. See 
"search-system-environment-symbols" & the supporting code.

> 
> (In portuguese, but I hope the code helps.)
> 
> Best wishes.
> Mario
> -- 
> http://parenteses.org/mario
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] mutate-procedure documentation


On Mar 8, 2014, at 10:12 AM, pluijzer .  wrote:

> Hello everybody,
> I was reading the documentation for mutate-procedure in the lolevel unit 
> (http://wiki.call-cc.org/man/3/Unit%20lolevel#mutate-procedure) but got 
> confused by the example given.
> Should 'new' not be called 'old', or do I misunderstand?

No misunderstanding.

> Thx,
> Pluijzer
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] DGBp?


On Mar 7, 2014, at 7:14 PM, John Cowan  wrote:

> Frank scripsit:
> 
>> Does the Chicken scheme interpreter support DBGp?
> 
> Probably not.  What is it?  Dr. Google is unhelpful.

Definitely not.

DBGP - A common debugger protocol for languages and debugger UI communication

http://xdebug.org/docs-dbgp.php

> 
> -- 
> Don't be so humble.  You're not that great. John Cowan
>--Golda Meirco...@ccil.org
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Nested hash-tables, and so on..


On Feb 9, 2014, at 11:12 AM, .alyn.post.  wrote:

> On Sun, Feb 09, 2014 at 03:29:09PM +0100, mfv wrote:
>> Hi, 
>> 
>> I've been fooling around a bit with chicken, and now I am on towards a small
>> project. I have a question regarding the performance of list and
>> hash-tables.
>> 
>> I plan to use nested hash tables as a data structure e.g.
>> 
>> hash-table1
>>  |
>>  key1
>> |
>> hash-table2
>>   |
>>   key2
>>  |
>>  list/string/some data
>> 
>> Are there objections to such a nested hash table structure e.g. should one
>> keep it as flat as possible and use multiple hash-table is parallel  in 
>> order to maximize performance?
>> 
> 
> In non-scheme languages, I use this technique a lot.  It's a poor
> man's struct, and when you don't exactly know what problem you're
> solving yet, that's precisely the data structure you need.
> 
> If you're worried about multiple hash table lookups, you can create
> a composite key: pick a character/object that won't appear in key1..n,
> and use it as a separator, joining and splitting your key to convert
> it to/from it's composite.  I've rarely used this technique, compared
> to the above above nested hash tables, so I suspect that nested
> hashing will be adequate to solving the problem you have in mind.

Any Scheme object can be hashed w/ the SRFI 69 "equal?-hash" function. So a 
composite key represented as a pair/list, vector, or record is feasible. 

> 
> I don't believe there is anything fundamentally wrong with your
> approach.
> 
> -a
> -- 
> my personal website: http://c0redump.org/
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Error: unbound variable: read-line


On Dec 13, 2013, at 9:46 AM, Daniel Beecham  wrote:

> Ah, sorry.
> I searched the mighty Google which indexed this mailing list (I got results 
> concerning readline, not read-line), but I didn't search the mailing list 
> specifically.

After sending I realized could be interpreted as a criticism, sorry. Needed an 
emoticon since intended an exclamation of wonder that the exact same procedure 
is in question in exactly 1 week.

> 
> Thank you for your help.
> 
> 
> On Fri, Dec 13, 2013 at 6:44 PM, Kon Lovett  wrote:
> (Wasn't the exact same issue asked & answered Dec 5th?)
> 
> On Dec 13, 2013, at 9:35 AM, Daniel Beecham  wrote:
> 
> > $ cat read.ss
> 
> (use extras)
> 
> > (let ((s (read-line))) (print s))
> > $ csc read.ss
> > $ ./read
> >
> > Error: unbound variable: read-line
> >
> > Call history:
> >
> > read.ss:1: read-line<--
> >
> > $ csi read.ss
> > [...]
> > ; loading read.ss ...
> > 
> > 
> > #;1> 
> >
> > $ chicken --version
> > [...]
> > Version 4.8.0.3 (Stability/4.8.0) (rev 091c3d9)
> > linux-unix-gru-x86-64 [ 64bit manyargs dload ptables ]
> > compiled 2013-03-13 on aeryn.xorinia.dim (Darwin)
> > [...]
> >
> > Any ideas why this might be happening?
> 
> The interpreter has a number of units/modules exposed by default. Must be 
> explicit with the compiler.
> 
> >
> > ___
> > Chicken-users mailing list
> > Chicken-users@nongnu.org
> > https://lists.nongnu.org/mailman/listinfo/chicken-users
> 
> 

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Error: unbound variable: read-line

(Wasn't the exact same issue asked & answered Dec 5th?)

On Dec 13, 2013, at 9:35 AM, Daniel Beecham  wrote:

> $ cat read.ss 

(use extras)

> (let ((s (read-line))) (print s))
> $ csc read.ss
> $ ./read
> 
> Error: unbound variable: read-line
> 
> Call history:
> 
> read.ss:1: read-line<--
> 
> $ csi read.ss
> [...]
> ; loading read.ss ...
> 
> 
> #;1> 
> 
> $ chicken --version
> [...]
> Version 4.8.0.3 (Stability/4.8.0) (rev 091c3d9)
> linux-unix-gru-x86-64 [ 64bit manyargs dload ptables ]
> compiled 2013-03-13 on aeryn.xorinia.dim (Darwin)
> [...]
> 
> Any ideas why this might be happening?

The interpreter has a number of units/modules exposed by default. Must be 
explicit with the compiler.

> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] alist-update


On Sep 26, 2013, at 6:59 PM, Matt Gushee  wrote:

> Hi,
> 
> I am just wondering if alist-update from data-structures is guaranteed
> to preserve order (assuming all keys to be updated are present in the
> original).

Yes. But not tail-recursive & result shares the source list tail. There is also 
a destructive version if you don't actually need a pure result.

> I can easily write my own function to do what I need, but
> I'd rather use the existing one if it does what I need.
> 
> TIA,
> Matt Gushee
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Big integers as statement parameters in sql-de-lite


On Jul 22, 2013, at 3:26 PM, Matt Gushee  wrote:

> Hi, chickenists--
> 
> I am working on an application that stores data in a SQLite3 database,
> and am currently using the sql-de-lite egg to interface with the DB. I
> have a few fields that represent dates, and I have defined their
> datatype as INTEGER.
> 
> However, when I attempt to execute a statement such as:
> 
>  INSERT INTO articles (node_id, title, created_dt) VALUES (?, ?, ?);
> 
> with one of these large integers bound to the third parameter, I get
> an error because apparently the value is too large. The values in
> question are obtained in the following manner:
> 
>  (time->seconds (date->time SRFI-19-DATE-OBJECT))
> 
> ... so a typical result is a number like 1291678156, which is a bignum.
> 
> Is there a way I can use these numbers as numbers in sql-de-lite, or
> do I have to convert them to something else?

(SQLite3 does have datetime functions for use in queries but assumes a string 
or UNIX timestamp.)

Do you need the range a SRFI-19 datetime provides? Maybe an epoch based 
approach, like provided by the posix module.

> 
> --
> Matt Gushee
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] representation of a procedure


On Jun 27, 2013, at 9:52 AM, "Daniel Ajoy"  wrote:

> Hi,
> 
> Is there a function that gives the content of a procedure (it's definition)?

The interpreter doesn't save the original s-expr & neither does the compiler. 
Reflection facilities are slim.

You can recover, sometimes, the expected argument list. See:

http://api.call-cc.org/doc/library#sec:procedure-information
http://wiki.call-cc.org/eggref/4/srfi-102

> 
> Daniel
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] dynamic scoping

Sadly, John Cowan's fine table of SRFI support by implementation doesn't cover 
SRFI 15.

In practice real dynamic variables - parameters - are the way to go for library 
or other distributed code. & they are in R7RS!

On Jun 26, 2013, at 3:01 PM, Dan Leslie  wrote:

> Oh you just had to be different. ;)
> 
> The related SRFI is withdrawn, is it safe to assume that fluid-let will be 
> available outside of Chicken?
> 
> -Dan
> 
> On 6/26/2013 2:56 PM, Kon Lovett wrote:
>> See http://api.call-cc.org/doc/chicken/special-forms#def:fluid-let
>> 
>> #;1> (define a 1)
>> #;2> (define (add x) (+ x a) )
>> #;3> (let ((a 100) ) (add 10) )
>> 11
>> #;4> (fluid-let ((a 100) ) (add 10) )
>> 110
>> 
>> 
>> On Jun 26, 2013, at 2:47 PM, "Daniel Ajoy"  wrote:
>> 
>>> "add" binds a to 1 at the moment of definition.
>>> 
>>> #;48> (define a 1)
>>> #;49> (define (add x) (+ x a) )
>>> #;50> (add 10)
>>> 11
>>> #;51> (let ((a 100) ) (add 10) )
>>> 11
>>> 
>>> Is there a way to give a different value of "a" to add, so that, something 
>>> like this happens:
>>> 
>>> (let ((a 100) ) (add 10) )
>>> 110
>>> 
>>> Daniel
>>> 
>>> ___
>>> Chicken-users mailing list
>>> Chicken-users@nongnu.org
>>> https://lists.nongnu.org/mailman/listinfo/chicken-users
>> 
>> ___
>> Chicken-users mailing list
>> Chicken-users@nongnu.org
>> https://lists.nongnu.org/mailman/listinfo/chicken-users
> 


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] dynamic scoping

See http://api.call-cc.org/doc/chicken/special-forms#def:fluid-let

#;1> (define a 1)
#;2> (define (add x) (+ x a) )
#;3> (let ((a 100) ) (add 10) )
11
#;4> (fluid-let ((a 100) ) (add 10) )
110


On Jun 26, 2013, at 2:47 PM, "Daniel Ajoy"  wrote:

> "add" binds a to 1 at the moment of definition.
> 
> #;48> (define a 1)
> #;49> (define (add x) (+ x a) )
> #;50> (add 10)
> 11
> #;51> (let ((a 100) ) (add 10) )
> 11
> 
> Is there a way to give a different value of "a" to add, so that, something 
> like this happens:
> 
> (let ((a 100) ) (add 10) )
> 110
> 
> Daniel
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] ANN: apropos egg 2.0.0

Works w/ the new Chicken.

Long time in the wilderness I know. My apologies.

Best Wishes,
Kon


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] error with srfi-19: /usr/lib/chicken/6/locale-posix.so: undefined symbol: C_fixnum_modulo

Cannot reproduce with CHICKEN Version 4.8.1 (rev 19a6b5b) 

But I will make a version that doesn't use the %proc routines.

On Dec 13, 2012, at 7:20 AM, Hugo Arregui  wrote:

> On Thu, Dec 13, 2012 at 12:20 PM, Hugo Arregui  wrote:
>> Oh sorry, i left the most important thing out!
>> 
>> $ csi -version
>> 
>> CHICKEN
>> (c)2008-2012 The Chicken Team
>> (c)2000-2007 Felix L. Winkelmann
>> Version 4.8.0 (rev 0db1908)
>> linux-unix-gnu-x86 [ manyargs dload ptables ]
>> compiled 2012-09-24 on debian (Linux)
>> 
>> 
>> Thanks!
>> 
>> On Thu, Dec 13, 2012 at 12:19 PM, Christian Kellermann
>>  wrote:
>>> Which chicken version is that?
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Apropos dependency error


On Dec 3, 2012, at 11:29 AM, Matt Gushee  wrote:

> Hello, Chickenistas--
> 
> I am going through my egg installation and updating some old ones, but I am 
> getting an error with apropos:
> 
>   Syntax error (import): cannot import from undefined module
> 
>   memoized-string
> 
> Checking further, I see that the memoized-string egg is no longer available,

It never existed. The string-utils egg contains the module. 

> but apropos.scm still contains:
> 
>   (require-library
>  
>  memoized-string
> 
> While I am waiting for an official fix, is there a simple workaround for this 
> error?
> 
> Thanks.
> --
> Matt Gushee
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] hash table questions


On Nov 23, 2012, at 1:58 PM, Kevin Wortman  wrote:

> Hi,
> 
> This may or may not be helpful, but I'll add that, if it were me, I'd 
> represent an IP address as a list of four fixnums rather than a u8vector. 
> Then the default hash function will work out of the box, and many of your 
> functions can be written more concisely. E.g.
> 
> (define IPv4-addr= equal?)
> 
> (define (IPv4-address->string a)
>   (string-intersperse (map number->string a) "."))
> 
> It's true that a u8vector will be a bit more space-efficient, but IMO it's 
> wise to refrain from that level of optimization unless and until it's the 
> only way to deal with an observed bottleneck.

Normally I wouldn't disagree with the basic idea here, although I would 
advocate a vector rather than list.

However the existing srfi-69 implementation doesn't follow a pair's references. 
(Also I think there is a bug where "list?" beats "pair?" in the type 
discrimination.)

But vectors (structures are treated as vectors) and vector-like objects do 
recurse into the contents, at least for 4 levels.

> 
> Regards,
> Kevin Wortman
> 
> 
> 
> On Thu, Nov 22, 2012 at 4:56 PM, Claude Marinier  wrote:
> Greetings fellow Schemers,
> 
> Having established in a previous post that using a u8vector as a key for a 
> hash table is expected to work, I have some specific questions.
> 
> I am still learning how to post questions properly. I hope this is clear and 
> contains enough information.
> 
> By the way, how can I make the included code display properly? In Mozilla 
> Firefox, it uses a proportional font.
> 
> 
> 1) Is using a hash function other than the default worth the trouble?
> 
> I define the hash table this way.
> 
> (define IPv4-table
>   (make-hash-table IPv4-addr= (make-fixnum-bounded-hash FNVAHash)))
> 
> (declare (inline IPv4-addr=))
> (define IPv4-addr=
>   (lambda (addr1 addr2)
> (and (= (u8vector-ref addr1 0) (u8vector-ref addr2 0))
>  (= (u8vector-ref addr1 1) (u8vector-ref addr2 1))
>  (= (u8vector-ref addr1 2) (u8vector-ref addr2 2))
>  (= (u8vector-ref addr1 3) (u8vector-ref addr2 3)
> 
> Would it be simpler, as effective, and almost as efficient to use the default?
> 
> P.S. Is this the correct way to specific an alternate hash function?
> 
> 
> 2) Is this the correct way to add new records to the table and update 
> existing records?
> 
> (define update-IPv4-counters
>   (lambda (addr direction proto tokens)
> (let ((IP-record (hash-table-ref/default IPv4-table addr #f)))
>   (cond
> ((not (vector? IP-record))
>   ; addr is not in the table, this is a new entry
>   (hash-table-set! IPv4-table addr
> (update-IP-record (make-IP-record) direction proto tokens)))
> (else
>   ; addr is in the table, increment packets and add bytes
>   (hash-table-set! IPv4-table addr
> (update-IP-record IP-record direction proto tokens)))
> 
> Note that an IP record is a seven elements vector (i.e. created with 
> make-vector).
> 
> If I understand SRFI-69 correctly, hash-table-set! will replace a record with 
> the same key. Is this correct? There cannot be duplicate keys, right?
> 
> 
> 3) This is how I dump the hash table.
> 
> (define dump-data
>   (lambda ()
> 
> (let*  ((outport (open-output-file (make-dump-file-name)))
> (dump-IPv4-record (lambda (address IP-record)
> (write-with-indent (IPv4-address->string address) 1 outport)
> (dump-IP-protocols IP-record 1 outport
> 
>   (write-with-indent "IPv4" 0 outport)
>   (hash-table-for-each IPv4-table dump-IPv4-record)
> 
>   ...
> 
> (define IPv4-address->string
>   (lambda (addr)
> (string-append
>   (number->string (u8vector-ref addr 0)) "."
>   (number->string (u8vector-ref addr 1)) "."
>   (number->string (u8vector-ref addr 2)) "."
>   (number->string (u8vector-ref addr 3
> 
> This code displays two records with the same key and different data. This has 
> happened more than once. I have kept the output files.
> 
> If I call hash-table-set! with the same address as another record but in a 
> different format (say a vector instead of a u8vector), would it choke or 
> would it just create a new record without complaining? This would look like 
> duplicate keys but they would be different.
> 
> I assume that hash-table-for-each will present each key / record pair once 
> and do so in some arbitrary order.
> 
> Can I assume that dump-IPv4-record, when it calls IPv4-address->string, will 
> choke on a key which is not a u8vector?
> 
> 
> 
> I am looking for the mistake I made which is producing the illusion of a 
> duplicate key in the hash table. I believe that confirming my assumptions is 
> a good starting point.
> 
> I hope this sort of question is not abusing the list members.
> 
> Thank you for your patience.
> 
> -- 
> Claude Marinier
> 
> 
> ___
> Chicke

Re: [Chicken-users] hash table questions


On Nov 22, 2012, at 7:32 PM, Kon Lovett  wrote:

> 
> On Nov 22, 2012, at 4:56 PM, Claude Marinier  wrote:
> 
>> Greetings fellow Schemers,
> 

>> or would it just create a new record without complaining? This would look 
>> like duplicate keys but they would be different.
> 
> The builtin hash will treat a u8vector & a vector of fixnum differently.
> 
> I suggest using a vector of fixnum as your IP-addr representation. I am 
> doubtful that records as keys are correctly processed.

Sorry, no doubts. Never mind.

> ex: (vector 192 168 1 16)

I retract this suggestion.

> 
>> 
>> I assume that hash-table-for-each will present each key / record pair once 
>> and do so in some arbitrary order.
> 
> Yes.
> 
>> 
>> Can I assume that dump-IPv4-record, when it calls IPv4-address->string, will 
>> choke on a key which is not a u8vector?
> 
> Yes.
> 
>> 
>> 
>> 
>> I am looking for the mistake I made which is producing the illusion of a 
>> duplicate key in the hash table. I believe that confirming my assumptions is 
>> a good starting point.
>> 
>> I hope this sort of question is not abusing the list members.
>> 
>> Thank you for your patience.
>> 
>> -- 
>> Claude Marinier
>> 
>> ___
>> Chicken-users mailing list
>> Chicken-users@nongnu.org
>> https://lists.nongnu.org/mailman/listinfo/chicken-users
> 


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] hash table questions


On Nov 22, 2012, at 4:56 PM, Claude Marinier  wrote:

> Greetings fellow Schemers,
> 
> Having established in a previous post that using a u8vector as a key for a 
> hash table is expected to work, I have some specific questions.
> 
> I am still learning how to post questions properly. I hope this is clear and 
> contains enough information.
> 
> By the way, how can I make the included code display properly? In Mozilla 
> Firefox, it uses a proportional font.
> 
> 
> 1) Is using a hash function other than the default worth the trouble?

Maybe, depending on the datatype used as a key. But in the case of a u8vector 
nothing in the hashes egg is suitable.

The hashes suite assumes the bits to be hashed are contiguous in memory. So it 
does not handle linked data in a useful manner. (The srfi-4 vectors are 
implemented using records & blobs. The FNVAHash will only see the record bits, 
not the actual data bits in the blob.)

> 
> I define the hash table this way.
> 
> (define IPv4-table
>   (make-hash-table IPv4-addr= (make-fixnum-bounded-hash FNVAHash)))
> 
> (declare (inline IPv4-addr=))
> (define IPv4-addr=
>   (lambda (addr1 addr2)
> (and (= (u8vector-ref addr1 0) (u8vector-ref addr2 0))
>  (= (u8vector-ref addr1 1) (u8vector-ref addr2 1))
>  (= (u8vector-ref addr1 2) (u8vector-ref addr2 2))
>  (= (u8vector-ref addr1 3) (u8vector-ref addr2 3)
> 
> Would it be simpler, as effective, and almost as efficient to use the default?

In this case.

> 
> P.S. Is this the correct way to specific an alternate hash function?

Yes.

> 
> 
> 2) Is this the correct way to add new records to the table and update 
> existing records?
> 
> (define update-IPv4-counters
>   (lambda (addr direction proto tokens)
> (let ((IP-record (hash-table-ref/default IPv4-table addr #f)))
>   (cond
> ((not (vector? IP-record))
>   ; addr is not in the table, this is a new entry
>   (hash-table-set! IPv4-table addr
> (update-IP-record (make-IP-record) direction proto tokens)))
> (else
>   ; addr is in the table, increment packets and add bytes
>   (hash-table-set! IPv4-table addr
> (update-IP-record IP-record direction proto tokens)))
> 
> Note that an IP record is a seven elements vector (i.e. created with 
> make-vector).
> 
> If I understand SRFI-69 correctly, hash-table-set! will replace a record with 
> the same key. Is this correct?

Yes.

> There cannot be duplicate keys, right?

No.

> 
> 
> 3) This is how I dump the hash table.
> 
> (define dump-data
>   (lambda ()
> 
> (let*  ((outport (open-output-file (make-dump-file-name)))
> (dump-IPv4-record (lambda (address IP-record)
> (write-with-indent (IPv4-address->string address) 1 outport)
> (dump-IP-protocols IP-record 1 outport
> 
>   (write-with-indent "IPv4" 0 outport)
>   (hash-table-for-each IPv4-table dump-IPv4-record)
> 
>   ...
> 
> (define IPv4-address->string
>   (lambda (addr)
> (string-append
>   (number->string (u8vector-ref addr 0)) "."
>   (number->string (u8vector-ref addr 1)) "."
>   (number->string (u8vector-ref addr 2)) "."
>   (number->string (u8vector-ref addr 3
> 
> This code displays two records with the same key and different data. This has 
> happened more than once. I have kept the output files.

See above.

> 
> If I call hash-table-set! with the same address as another record but in a 
> different format (say a vector instead of a u8vector), would it choke

No.

> or would it just create a new record without complaining? This would look 
> like duplicate keys but they would be different.

The builtin hash will treat a u8vector & a vector of fixnum differently.

I suggest using a vector of fixnum as your IP-addr representation. I am 
doubtful that records as keys are correctly processed. ex: (vector 192 168 1 16)

> 
> I assume that hash-table-for-each will present each key / record pair once 
> and do so in some arbitrary order.

Yes.

> 
> Can I assume that dump-IPv4-record, when it calls IPv4-address->string, will 
> choke on a key which is not a u8vector?

Yes.

> 
> 
> 
> I am looking for the mistake I made which is producing the illusion of a 
> duplicate key in the hash table. I believe that confirming my assumptions is 
> a good starting point.
> 
> I hope this sort of question is not abusing the list members.
> 
> Thank you for your patience.
> 
> -- 
> Claude Marinier
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Modules in shared libs?


On Nov 21, 2012, at 1:13 PM, Matt Gushee  wrote:

> Hi--
> 
> I am developing a project that is going to use plugins. It's at a very early 
> stage, and I am not at all sure how the details of the system will work, but 
> my thinking at this point is that the plugins:
> 
>  - may be either compiled or interpreted, but will usually be 
>compiled as shared libraries; and
>  - will be stored in one or more arbitrary locations separate from 
>the system's egg repository.
>  - should ideally be implemented as modules.
> 
> So I think what I want to do is to load shared libraries containing modules 
> into compiled code. Toward that end, I have been experimenting with some toy 
> code to try to understand the various ways that different compilation units 
> interact. I have four library units, 'a', 'b', 'c', and 'd', and two 
> top-level units, 'ab' (which uses 'a' and 'b'), and 'cd' (which uses 'c' and 
> 'd'). The important difference between the libraries is that 'c' and 'd' 
> declare modules, while 'a' and 'b' do not.  Here's the code:
> 
>   ; a.scm
>   (define (ay) (print "Ay, what's 'appening?"))
>   
>   ; b.scm
>   (define (bee) (print "2B or not 2B?"))
>   
>   ; c.scm
>   (module c
>   *
>   (import scheme)
>   (import chicken)
>   
>   (define (see) (print "See Spot run."))
>   
>   )
>   
>   ; d.scm
>   (module d
>   *
>   (import scheme)
>   (import chicken)
>   
>   (define (dee) (print "Defenestrate depraved demons."))
>   
>   )
>   
>   ; ab.scm 
>   (load-relative "a.so")
>   (load-relative "b.so")
>   
>   (ay)
>   (bee)
>   
>   : cd.scm
>   (load-relative "c.so")
>   (load-relative "d.so")
>   
>   (import c)
>   (import d)
>   
>   (see)
>   (dee)
> 
> And here's what happens when I try to work with them:
> 
>   $ csc -dynamic a.scm
>   $ csc -dynamic b.scm
>   $ csc -dynamic c.scm
>   $ csc -dynamic d.scm
>   $ csi
>   
>   CHICKEN
>   (c)2008-2012 The Chicken Team
>   (c)2000-2007 Felix L. Winkelmann
>   Version 4.8.0 (rev 0db1908)
>   linux-unix-gnu-x86 [ manyargs dload ptables ]
>   compiled 2012-09-24 on debian (Linux)
>   
>   ... [ loading ~/.csirc and various eggs ] ...
>   
>   csi> (load "ab.scm")
>   ; loading ab.scm ...
>   ; loading a.so ...
>   ; loading b.so ...
>   Ay, what's 'appening?
>   2B or not 2B?
>   csi> (load "cd.scm")
>   ; loading cd.scm ...
>   ; loading c.so ...
>   ; loading d.so ...
>   See Spot run.
>   Defenestrate depraved demons.
>   csi> 
>   $ csc ab.scm
>   $ ./ab
>   Ay, what's 'appening?
>   2B or not 2B?
>   $ csc cd.scm
>   
>   Syntax error (import): cannot import from undefined module
>   
>   c

You need an "import" file for module c. They are not generated automatically.

csc c.scm -dynamic -emit-import-library c   ; csc c.scm -s -j c
csc c.import.scm -dynamic

> 
> By the way, in addition to 'load-relative', I've also tried loading the libs 
> by means of 'require' (with and without the so-name), 'load', and 
> 'require-library'. In no case have I managed to compile a unit that loads a 
> library containing a module.
> 
> So, I hope it is reasonably clear what I am trying to do here. Is this
> something that is supposed to work? Is there perhaps a compiler directive 
> that would solve this problem?
> 
> --
> Matt Gushee
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Why doesnot "(+ 1/2 1/3)" equal to 5/6 ?


On Nov 7, 2012, at 4:17 PM, ".alyn.post."  
wrote:

> On Wed, Nov 07, 2012 at 11:57:33PM -, z_axis wrote:
>> 
>>> (+ (+ 1/2 1/3)
>> 
>> Warning: cannot represent exact fraction - coerced to flonum: "1/2"
>> Warning: cannot represent exact fraction - coerced to flonum: "1/3"
>> 0.8331/2 1/3)
>> 
>> 
>> In racket, it is 5/6. And as i know it is 5/6 for any lisp implementation.

Oh, LISP is a much larger family. ;-)

>> 
>> 
>> Sincerely!
>> 
> 
> I suspect in Racket your above code is a syntax error.  ;-)
> 
> More seriously, try this:
> 
>  (use numbers)
>  (+ (+ 1/2 1/3))
> 
> That gives you the answer you expect.

But only if the numbers egg is installed:

chicken-install -test numbers

Chicken does not support the full numeric tower by default. An extension must 
be used.

> 
> -Alan
> -- 
> .i ma'a lo bradi cu penmi gi'e du
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] What is the purpose of module interfaces?


On Oct 16, 2012, at 4:11 PM, Matt Gushee wrote:

> Hi, Kon--
> 
> On Tue, Oct 16, 2012 at 4:52 PM, Kon Lovett  wrote:
> 
> On Oct 16, 2012, at 3:40 PM, Matt Gushee wrote:
> 
> > I am trying to understand the usage of module interfaces
> 
>  
> 
> The 'functor' facility is for generic programming.
> 
> Yes, I'm familiar with functors from my time programming in OCaml. I found 
> them quite useful on occasion.
>  
> The levenshtein egg uses functors to abstract cost arithmetic & sequence 
> access.
> 
> Okay, I've looked at your code, and I am starting to understand. Shouldn't 
> this usage be documented? The page on modules in the manual makes no explicit 
> association between interfaces and functors. Indeed, I don't see any hint 
> that interfaces can be used in functor definitions the way you do in your egg.

See http://wiki.call-cc.org/man/4/Modules.html#functors

Buried at the bottom.

> 
> Thanks for the info.
> 
> --
> Matt Gushee
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Problem with uuid-lib egg

Please try uuid-lib 1.4.1

It passes the Linux platform Salmonella run.

On Aug 17, 2012, at 7:11 PM, Kon Lovett wrote:

> 
> On Aug 17, 2012, at 1:47 PM, John Maxwell wrote:
> 
>> Hi all-
>> 
>> I'm writing some code which needs to generate uuids, so naturally I
>> turned to the uuid-lib egg. My problem is, the egg needs libuuid.so
>> (since the egg is basically a thin wrapper around that library), and
>> this is causing me headaches.
>> 




___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Problem with uuid-lib egg


On Aug 17, 2012, at 1:47 PM, John Maxwell wrote:

> Hi all-
> 
> I'm writing some code which needs to generate uuids, so naturally I
> turned to the uuid-lib egg. My problem is, the egg needs libuuid.so
> (since the egg is basically a thin wrapper around that library), and
> this is causing me headaches.
> 
> When I compile my code, I add -luuid to the csc link command, like so:
> 
>csc -o my-app my-app.o more-code.o -luuid
> 
> and all is well. However, I also need to run the same code using csi
> (for unit testing purposes), and this doesn't work so well; csi
> segfaults out the first time that I try to call any of the uuid
> functions.
> 
> Obviously, I could rebuild csi to link against libuuid (or play games
> with using the ELF utilities to modify the binary and add libuuid to
> it's dependencies), but this feels... wrong.
> 
> Is this a bug in the egg (i.e., should the egg take care of pulling in
> libuuid)?

Yes.

I have only tested w/ MacOS X, where explicit use of libuuid is not required. 
The .setup file needs to me amended as:

(setup-shared-extension-module 'uuid-lib (extension-version "1.4.1")
  compile-options: '(
-L -luuid  ;this is the new bit
-scrutinize
-fixnum-arithmetic

I will release a new version that tests for the 'software-version' and extends 
the options accordingly. For now if you could try what Mario suggested, get the 
source & test w/ the proposed change it would help.

Sorry for the trouble.

> Or is it inherent in the design of Chicken? Or... what?

No, all my fault.

> 
> Suggestions, workarounds, etc. deeply appreciated.
> 
> -John
> 
> -- 
> John Maxwell  john.maxw...@openamplify.com
> Software Developer, OpenAmplify
> 
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Building a web store in Chicken scheme


On May 8, 2012, at 12:50 PM, Christian Kellermann wrote:

> * Christian Kellermann  [120508 21:45]:
>>> I need functions like "my_sql_real_escape_string" and "htmlspecialchars" in
>>> php. I also need to know how to add ssl support (is it only configuration?).
>>> If someone is willing to help me I will be glad.
>> 
>> As for SQL there are several extensions, we call them eggs,
>> available. All of them help you building your queries and taking care
>> of escaping your variable input if necessary.
> 
> Oh, one more thing. The supported SQL database in chicken land is
> postgres. So far noone has written bindings for mysql. So if you need
> mysql support you would have to do this first.

The Chicken 3 vintage mysql egg might be a place to start.

> 
> On the other hand people that have dealt with both (I haven't) suggest
> that you should consider to switch to a real database and use postgres
> :)
> 
> Cheers,
> 
> Christian
> 
> --
> 9 out of 10 voices in my head say, that I am crazy,
> one is humming.
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Ignore -rpath for mingw & macosx

Attached is a patch that ignores the '-rpath ' option for mingw & 
macosx; MacOS X ld doesn't understand '-R'. 



ignore_rpath_for_macosx.patch
Description: Binary data
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Regexp egg compilation error


On Mar 12, 2012, at 8:54 PM, Arthur Maciel wrote:

> Oh, how silly I was! 
> 
> Well, now it I get another question:  does awful egg accepts irregex syntax 
> instead of regex egg one? The documentation still suggests the use of regex 
> egg.

AFAIK awful uses POSIX-style rather than SRE but since regex is a thin wrapper 
over irregex I suspect the result of an irregex constructor will be accepted.

> 
> Thanks,
> Arthur
> 
> 2012/3/13 Kon Lovett 
> 
> I think the extension is called "regex": 
> http://wiki.call-cc.org/eggref/4/regex
> 
> BTW, this is for temporary backwards-compatibility. New code should use 
> irregex: http://wiki.call-cc.org/man/4/Unit%20irregex
> 
> On Mar 12, 2012, at 8:14 PM, Arthur Maciel wrote:
> 
>> Hello! I'm getting the following error:
>> 
>> $ sudo chicken-install regexp
>> retrieving ...
>> resolving alias `kitten-technologies' to: 
>> http://chicken.kitten-technologies.co.uk/henrietta.cgi
>> connecting to host "chicken.kitten-technologies.co.uk", port 80 ...
>> TCP connect timeout
>> resolving alias `call-cc.org' to: 
>> http://code.call-cc.org/cgi-bin/henrietta.cgi
>> connecting to host "code.call-cc.org", port 80 ...
>> requesting "/cgi-bin/henrietta.cgi?name=regexp&mode=default" ...
>> reading response ...
>> HTTP/1.1 200 OK
>> Date: Tue, 13 Mar 2012 02:49:21 GMT
>> Server: Apache/2.2.9 (Debian) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g
>> Connection: close
>> Vary: Accept-Encoding
>> Transfer-Encoding: chunked
>> Content-Type: text/plain
>> reading chunks .
>> reading files ...
>>  regexp located at /tmp/temp5d09/regexp
>> 
>> Warning: extension `regexp' has no .meta file - assuming it has no 
>> dependencies
>> install order:
>> ()
>> 
>> 
>> Is the error mine of is the package compromised?
>> 
>> Thanks!
>> Arthur
>> ___
>> Chicken-users mailing list
>> Chicken-users@nongnu.org
>> https://lists.nongnu.org/mailman/listinfo/chicken-users
> 
> 

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Regexp egg compilation error


I think the extension is called "regex": http://wiki.call-cc.org/eggref/4/regex

BTW, this is for temporary backwards-compatibility. New code should use 
irregex: http://wiki.call-cc.org/man/4/Unit%20irregex

On Mar 12, 2012, at 8:14 PM, Arthur Maciel wrote:

> Hello! I'm getting the following error:
> 
> $ sudo chicken-install regexp
> retrieving ...
> resolving alias `kitten-technologies' to: 
> http://chicken.kitten-technologies.co.uk/henrietta.cgi
> connecting to host "chicken.kitten-technologies.co.uk", port 80 ...
> TCP connect timeout
> resolving alias `call-cc.org' to: 
> http://code.call-cc.org/cgi-bin/henrietta.cgi
> connecting to host "code.call-cc.org", port 80 ...
> requesting "/cgi-bin/henrietta.cgi?name=regexp&mode=default" ...
> reading response ...
> HTTP/1.1 200 OK
> Date: Tue, 13 Mar 2012 02:49:21 GMT
> Server: Apache/2.2.9 (Debian) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g
> Connection: close
> Vary: Accept-Encoding
> Transfer-Encoding: chunked
> Content-Type: text/plain
> reading chunks .
> reading files ...
>  regexp located at /tmp/temp5d09/regexp
> 
> Warning: extension `regexp' has no .meta file - assuming it has no 
> dependencies
> install order:
> ()
> 
> 
> Is the error mine of is the package compromised?
> 
> Thanks!
> Arthur
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] case vs. eq? - just curious ....


On Mar 2, 2012, at 3:52 PM, Matt Welland wrote:

> I expected this to work:
> 
> (define (comp->text comp)
>   (case comp
>((=)"=")
>((>)">")
>((<)"<")
>((>=)  ">=")
>((<=)  "<=")
>(else "unk")))
> 
> But had to convert to a cond with (eq? comp =) etc...

Are =, >, etc variables? 'case' quotes the objects in each "case". So comparing 
against symbols.

(##core#let
  ((tmp '=))
  (##core#if
(or (eqv? tmp '=))
(##core#begin "=")
(##core#if
...

> 
> I thought case was supposed to use eq? to do the compare?

eqv?

> 
> Thanks,
> 
> M a t t
> -=-
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Installing on Mac OS 10.7.3


On Feb 15, 2012, at 7:21 AM, Jim Ursetto wrote:

> Ok, then also add ARCH=x86-64 like you had originally.  It was my understand 
> this wasn't needed on 10.6 or 10.7

Not needed in my experience. (Lion on a MacBook Pro). I use "make 
PLATFORM=macosx C_COMPILER=gcc-4.2"

> and I thought I confirmed that, but maybe not.  Let me know if it works, and 
> if so, what the output of `uname -a` on your system is.





___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] md5 egg documentation wrong


On Dec 15, 2011, at 10:16 AM, obscurolocon...@googlemail.com wrote:

> The documentation for the md5 egg states:
> 
>> Any Scheme-object can be the SOURCE for a digest.
> 
> But that seems to be wrong:

It is wrong, or at least incomplete, without the sentence below it in the doc: 
"See [[message-digest]] for more information." Misleading in any case.

The "Message Digest" doc section "Common Argument Definitions" has a discussion 
of the interpretation of the "SOURCE" argument. Only something that can easily 
be massaged into a byte-vector is supported.

Using the 'message-digest-chunk-converter' & the "s11n" egg 'serialize' (to a 
string port) it should be possible to get a digest of a cons cell. (Be nice if 
blob-ports existed.)

Example:

#;1> (use s11n ports)
#;2> (call-with-output-string (cut serialize '(1 . 2) <>))
"\x05\x02\x00\x00\x00\x00\x00\x00\x03\x03\x03\x00\x00\x00\x00\x00\x00\x00\x03\x05\x00\x00\x00\x00\x00\x00\x00"

So:

(message-digest-chunk-converter (lambda (obj) (call-with-output-string 
(cut serialize obj <>

should be enough.

Sorry,
Kon

> 
>> (md5-digest (cons 1 2))
> 
> Error: (message-digest-update-object) indigestible object: (1 . 2)
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] numeric-macros: -- increments instead of decrementing


On Dec 2, 2011, at 7:31 AM, Markus Klotzbuecher wrote:

> Hi All,
> 
> I just noticed the following:
> 
> #;1> (use numeric-macros)
> ; loading /var/lib//chicken/6/numeric-macros.import.so ...
> ; loading /var/lib//chicken/6/numeric-macros.so ...
> #;2> (++ 3)
> 4
> #;3> (-- 3)
> 4
> #;4> 
> 
> This doesn't seem right :-)

& isn't. Of course the tests pass - all '-' were copies of '+'. Fixed in 1.3.1 
which is available now.

Much egg on face.

> 
> Best regards
> Markus
> 
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] inline vectors vs. srfi-9 records vs. non-inlined vectors -- or -- anything faster than srfi-9?


On Oct 8, 2011, at 6:40 PM, Matt Welland wrote:

> I'm in the habit of using inlined vector access for poor mans records:
> 
> (define-inline (db:test-get-id   vec) (vector-ref vec 0))
> (define-inline (db:test-get-run_id   vec) (vector-ref vec 1))
> 
> 
> on the assumption that it is as fast as you can get. I'm converting some code 
> to units for faster build times and obviously inline doesn't work across 
> units so I looked at switching to srfi-9 records but they seem really slow. A 
> simple testcase gave me the following:
> 
> vectors inline:2.94s
> vectors not inline:  6.43s
> srfi-9 records:  14.16s
> 
> Is there a faster record system to use? 

Someone has probably mentioned the 'record-variants' egg. The cost you are 
paying w/ srfi-9 (or 'defined-record') can be see using the expand macro 
facility of the csi.

> 
> BTW, I'm not claiming the use of records will materially impact the 
> performance of my program but I don't see much advantage to records over what 
> I'm doing now and it seems that bad performance is always waiting around the 
> corner to bite me so why risk it?

I certainly commiserate but why worry about it until you must. Safety first ;-)

> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] chicken hangs and uses 100% cpu (mac os x lion)

This might be relevant - was for me:

http://lists.nongnu.org/archive/html/chicken-users/2011-08/msg5.html

But what is actually the problem would be good to know.

On Sep 13, 2011, at 5:56 PM, Topher Cyll wrote:

> Hey everyone,
> 
> Like a previous poster, I'm having issues with Chicken on Mac OS X
> (although for me the issues are on Lion, not Snow Leopard).
> 
> I started building from MacPorts (4.4.0) and had the same issue as the
> previous poster.  The build succeeds, but trying to run csc or csi
> results in what appears to be an infinite loop (no output and 100% cpu
> usage).
> 
> Since then, I've built from the source releases for: 4.7.0, 4.6.0,
> 4.5.0, 4.4.0, 4.3.0, 4.2.0, 4.1.0, and 4.0.0.  All of them build
> correctly, but when I run "install", the process hangs on
> "chicken-install -update-db" and cpu usage goes to 100% again.
> 
> I've also tried building from HomeBrew (4.7.0) and it also hangs while
> updating the db.
> 
> Am I right that chicken-install is executing code written in chicken?
> I'm not completely positive this is the same problem, but it seems
> likely.
> 
> Also, I'm not sure I did this right, but I tried to do a system trace
> using Instruments (which ships with XCode).  I was hoping for a
> smoking gun, but all I see is this repeated over and over again:
> 
> BSC_sigprocmask
> BSC_sigreturn
> 
> Not sure how to interpret that, although it seems like something
> involving signal handlers might be unhappy?
> 
> Anyone else bumped into this?  I'm happy to try to figure out what's
> going on if anyone has any suggestions.  Is there any way to build a
> debug version of chicken?
> 
> Thanks everyone,
> Topher
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] catching a "cannot import undefined module" error


On Aug 20, 2011, at 7:59 AM, Hugo Arregui wrote:

> Hi guys,
> 
> is there a way to catch  "cannot import undefined module" error?
> 
> I tried with catch and "with-exception-handler" procedures, but they
> don't seems to work.

This is raised as a syntax-error & these do not use the exception machinery. 
(Evaluated in a toplevel context anyway so the actual meaning of "(lambda () 
(import foo) ...)" is probably not what one expects.)

Maybe if you describe in more detail what you want to accomplish someone can 
provide a more fulfilling answer.

Kon

> 
> Thanks!
> Hugo.
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] About peformance of user defined procedures


On Jul 30, 2011, at 4:43 PM, Pedro Henrique Antunes de Oliveira wrote:

> Hey.
> 
> I have a file map.scm, which contais this code:
> 
> (define (mymap1 op ls)
>  (let loop ((ls ls) (acc '()))
>(if (null? ls)
>(reverse acc)
>(loop (cdr ls) (cons (op (car ls)) acc)
> 
> (define (mymap2 op ls)
>  (let loop ((ls ls))
>(if (null? ls)
>'()
>(cons (op (car ls)) (loop (cdr ls))
> 
> (define (mymap3 op ls)
>  (if (null? ls)
>  '()
>  (cons (op (car ls)) (mymap3 op (cdr ls)
> 
> (define ls (let loop ((i 0)) (if (= i 100) '() (cons i (loop (add1 i))
> 
> And another four files, f1.scm, f2.scm, f3.scm, f4.scm.
> 
> f1.scm
> (include "map.scm")
> (map add1 ls)
> 
> f2.scm
> (include "map.scm")
> (mymap1 add1 ls)
> 
> f3.scm
> (include "map.scm")
> (mymap2 add1 ls)
> 
> f4.scm
> (include "map.scm")
> (mymap3 add1 ls)
> 
> Compiling all four f[1-4].scm files, with csc -O3, I got those results:
> 
> f1 took 0.95secs (average)
> f2 took 1.65secs (average)
> f3 took 1.35secs (average)
> f4 took 1.35secs (average)
> 
> I understand why f4 and f3 are pretty much the same thing, but what
> differs from mine to the built in map that makes the built in so
> faster (2-3x faster)?

I think map is one of the procedures "open-coded" by the compiler.

> 
> Interpreted languages have this characteristic that built in
> procedures tend to be much faster, but this all is compiled. I suppose
> it is possible to make procedures, in chicken/scheme that are as fast
> as the built in one. Right?

See compiler macros.

> 
> Note: compiling with -O5 instead of -O3 made the programs 0.1secs "shorter".
> Note2: this is not about map specifically (I've been looking at some
> procedures that I have that look somewhat to some built in ones, but
> are much slower)
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] About egg version identifier


Hi Folks,

Please be aware the version identifier information from a .setup file  
is parsed using `read'. So be careful with a version identifier which  
will be interpreted as an inexact number, e.g. 1.10 will be version  
1.1! To preserve meaning use a string form - "1.10".


Thank you,
Kon


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] What is the charset of the characters of a string literal?


On Jul 16, 2011, at 5:35 PM, Pedro Henrique Antunes de Oliveira wrote:

> What is the charset of the characters of a string literal?
> 
> Is it the source file's charset?

Yes, since it only understands Unicode in the UTF-8 encoding. So the following 
is valid (embedded \u44A5 codepoint):

(string-length (symbol->string 'ab䒥cd)) ;=> 7

(Chicken w/o the utf8 egg cannot easily, or correctly, manipulate UTF-8 strings 
using the usual Scheme APIs however.)

> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] remote-mailbox


(I responded directly & forgot to CC the list.)

On Jul 9, 2011, at 6:22 PM, David N Murray wrote:


$ csi

CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.7.0
linux-unix-gnu-x86 [ manyargs dload ptables ]
compiled 2011-07-09 on localhost (Linux)

#;1> (use remote-mailbox)


Sorry for the confusion.

There isn't a "remote-mailbox" module. In the client "remote-mailbox- 
client " is used, and in the server, "remote-mailbox-server" is used.  
The separate extension info "remote-mailbox" exists so people can put  
dependencies on it in .meta files.


See the Usage sections of the documentation.



Error: (import) during expansion of (import ...) - cannot import from
undefined module: remote-mailbox

Call history:

(use remote-mailbox)
(##core#require-extension (remote-mailbox) #t)
(##core#begin (##core#begin (##core#begin
(##sys#require (quote remote-mailbox))) (import remote-mai..
(##core#begin (##core#begin (##sys#require
(quote remote-mailbox))) (import remote-mailbox))
(##core#begin (##sys#require (quote
remote-mailbox)))
(##sys#require (quote remote-mailbox))
(quote remote-mailbox)
(##core#quote remote-mailbox)
(import remote-mailbox)   <--
#;1> ^D

$ chicken-status ; just the remote mailbox pertinent eggs
lookup-table .  
version: 1.13.4
lookup-table-synch ...  
version: 1.13.4
lookup-table-unsafe ..  
version: 1.13.4
lookup-table-unsafe-synch   
version: 1.13.4
mailbox ...  
version: 2.1.3
miscmacros .  
version: 2.92
remote-mailbox   
version: 2.0.1
remote-mailbox-client .  
version: 2.0.1
remote-mailbox-common .  
version: 2.0.1
remote-mailbox-server .  
version: 2.0.1
s11n   
version: unknown
synch .  
version: 2.1.1
tcp-server ..  
version: 1.2
type-errors ..  
version: 1.12.5


Thoughts?  I get the same error on MacOSX.  I retrieve the egg and can
load the pieces and there's no error.  I'm not sure how else to  
debug it

to isolate the problem.

TIA,
Dave

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users



___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Problem w/ a new egg


Thank you. Forgot completely about the "new egg release system".


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] Problem w/ a new egg


Hi Folks,

Having a "me too stupid" problem:

I added an egg - csv-xml - to the svn repo Sat. Attempts to install  
yield:


Warning: extension `csv-xml' has no .meta file - assuming it has no  
dependencies


My initial save did not list the .meta in the files manifest so the  
above msg made some sense. I quickly remedied the oversight. But I  
still get the msg. (And yes, chicken-install works with -transport  
local.)


Any ideas before I dig into the chicken-install source?

Thank you,
Kon



___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] where move-file is?


On Jun 30, 2011, at 6:04 AM, Hugo Arregui wrote:

> Hi guys,
> 
> I want to use move-file procedure, (
> http://api.call-cc.org/doc/chicken/eggs/move-file ), but i cannot find
> it as an egg or as an procedure. I mean, seems an egg, but
> chicken-install cannot find it, and doesn't seems installed already.
> Can you give me an advice?

Unit files file-move

> 
> (i tried chicken 4.5.0 and 4.6.0)
> 
> Thanks,
> Hugo.
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] ANN: The `str#' macro


Hi,

Just added `str#' to the moremacros egg. It behaves like #<# but for  
regular strings. Might be useful.


(str# "(+ 1 2) = #{(+ 1 2)}")	=> "(+ 1 2) = 3" 	<= (conc "(+ 1 2) =  
" (+ 1 2))


(str# "(+ 1 2) = #(+ 1 2)")	=> "(+ 1 2) = 3"	<= (conc "(+ 1 2) = " (+  
1 2))


(str# "#{23}###{45}") => "23#45" <= (conc 23 "#" 45)

(Does not require data-structures to be imported even though conc is  
used.)


Best Wishes,
Kon


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Different factorial results



On Jun 3, 2011, at 9:49 AM, John Cowan wrote:


Steve Graham scripsit:

Thanks, Mario.  Worked like a charm.  Why is that not part of the  
base

package?


Licensing.  The numbers egg has to be GPL, because it depends on the  
GMP

(GNU Multi-precision Library) which is GPL.  The overall license for
Chicken, however, is BSD.  There are alternatives to the GMP, but it  
is

the gold standard: fast, accurate, space-conserving.


Current numbers egg is w/o GMP.



--
   Si hoc legere scis, nimium eruditionis habes.

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users



___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Possible numbers bug



On May 27, 2011, at 1:02 PM, Matt Welland wrote:


Bit easier to compare the md5sum of the result :)

Using 4.6.5 on 64bit:

chlr11732> csi -b -n -q blah.scm | md5sum
e8e0bb7648422c33ce821c53e7af02d0  -

chlr11732> ./blah | md5sum
e8e0bb7648422c33ce821c53e7af02d0  -

stk (not stklos):
./blah2.stk | md5sum
75635ac7a6c8b9c3cc98227f92e272ab  -
(num is 10003.24324)

Bah! No, md5sum is not the way to go - subtleties such as newlines can
mess it up.


csi -b -n -q -e '(use md5 message-digest numbers) (define (sum-of- 
exponents n lim) (if (> n lim) 0 (+ (expt n n) (sum-of-exponents (+ n  
1) lim (print (message-digest-string (md5-primitive) (number- 
>string (sum-of-exponents 1 1000'

Chicken PPC:
520cbadfbf1e95567b1b49bd543fa8ab
Chicken x86:
520cbadfbf1e95567b1b49bd543fa8ab

(Done as above but w/ a string literal rather than the`(number->...)'  
expression.)

Racket:
520cbadfbf1e95567b1b49bd543fa8ab

Note that using the RSA utility md5 & string literals I get the same  
digest value.




On Fri, May 27, 2011 at 10:21 AM, Kon Lovett   
wrote:


On May 27, 2011, at 1:58 AM, Dominic Pearson wrote:


Hello folks,

I am trying to compute the sum i = 0 to n where n = 1000 of n^n, but
chicken seems to return the incorrect answer.

http://paste.call-cc.org/paste?id=e0884580a684d1220f3dedb819f63201b6f5eb1a

Racket and scheme48 both seem to give different answers too.


Using

CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.7.0
macosx-unix-gnu-ppc [ manyargs dload ptables ]
compiled 2011-05-25 on Nikko.local (Darwin)

&

CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.7.0
macosx-unix-gnu-x86 [ manyargs dload ptables ]
compiled 2011-05-25 on Otter.local (Darwin)

I get the Racket answer.



___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users



___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users




___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Possible numbers bug



On May 27, 2011, at 1:58 AM, Dominic Pearson wrote:


Hello folks,

I am trying to compute the sum i = 0 to n where n = 1000 of n^n, but
chicken seems to return the incorrect answer.

http://paste.call-cc.org/paste?id=e0884580a684d1220f3dedb819f63201b6f5eb1a

Racket and scheme48 both seem to give different answers too.


Using

CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.7.0
macosx-unix-gnu-ppc [ manyargs dload ptables ]
compiled 2011-05-25 on Nikko.local (Darwin)

&

CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.7.0
macosx-unix-gnu-x86 [ manyargs dload ptables ]
compiled 2011-05-25 on Otter.local (Darwin)

I get the Racket answer.



___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users



___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Cleaning up SRFI support claims



On May 26, 2011, at 10:46 AM, Jim Pryor wrote:


Hi Kon, thanks for your reply.


On Thu, May 26, 2011 at 10:06:26AM -0700, Kon Lovett wrote:
3. This page <http://wiki.call-cc.org/man/4/Getting%20started>  
lists a

variety of SRFIs Chicken allegedly supports.





each of these SRFI covers; this is just a bulk report.)


-7 was never supported TMK. Where is this SRFI referenced?


At the link at the start of the above quotation.


Ahh, as part of the "SRFIs ..., 6-19, ...". Yes, this is wrong.






Why don't we just remove these srfi numbers from the list at the  
linked wiki

page?


The <http://wiki.call-cc.org/man/4/Getting%20started>  page should  
probably only mention the builtin SRFIs. Or provide a link to the <http://wiki.call-cc.org/supported-standards 
> page.






4. The SRFI-modules egg, at least according to its documentation at
<http://wiki.call-cc.org/eggref/4/srfi-modules>, neglects to  
provide an

import library for SRFIs 61, 62, 88, yet these are part of my base
install. Perhaps 46 also, though that came in a later version of  
Chicken

than I have installed.


-61 would export `cond'?


It doesn't need to export anything, I guess, since the => syntax for
cond is already in the base chicken install. I admit I'm not too clear
on the purpose of this srfi-modules egg. I was just confused because
this egg seems to provide a list of SRFIs supported in the base  
install

but it doesn't include 61, 62, 88, or 46. Perhaps a
explanatory mention on the egg's docpage would be useful.


Felix could probably delegate this.






--
Jim Pryor
prof...@jimpryor.net

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users



___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Cleaning up SRFI support claims


On May 26, 2011, at 6:47 AM, Jim Pryor wrote:

> 
> Apologies if this has already been discussed, I haven't been following
> the list steadily and a cursory search didn't show anything.
> 
> I'm seeing some inconsistent information at different places on the wiki
> about what SRFIs Chicken currently supports, either in the base install
> or in eggs. Here are what look to me like the problem spots.


Yes, this is an area with low priority.

> 
> 1. The manual says Chicken supports SRFI-69 with SRFI-90 extensions.
> I can do a (use srfi-69) but when I do (use srfi-90), the command fails.
> Should this command perhaps succeed silently, or succeed silently if srfi-69 
> has already been loaded? Perhaps more recent versions of Chicken do; I 
> haven't yet upgraded from 4.6.3.

I guess when "srfi-69" loads it could provide 'srfi-90 but don't know if worth 
the trouble to support '(use srfi-90)' .

> 
> 2. This page  says we
> support SRFIs 33 and 101 via eggs. Is that true? I don't see any such
> eggs at .

-101. I will release this but not sure how useful.

-33 has an SVN repo dir but it is empty. 33 was withdrawn anyway. The reference 
will be removed.

> 
> 3. This page  lists a
> variety of SRFIs Chicken allegedly supports.
>However, it may leave some out. (Again, perhaps this has to do with
> the difference between my version 4.6.3 and the current 4.7.0. But I
> doubt support was removed for any eggs.) These seem to be supported in
> the base install, but aren't listed on that page: 46, 88; and
> these seem to be supported in eggs, but aren't listed on that page: 34,
> 41, 71, 102. (And perhaps also 33 and 101, see previous item.)
>It may include some it shouldn't: that page says we support SRFIs 7,
> 47, 57, 66, 72, 85. Is that true? My base-install fails when I try to
> require those, and I don't see eggs for them. (I'm not going to look what
> each of these SRFI covers; this is just a bulk report.)

-7 was never supported TMK. Where is this SRFI referenced?

-47 available Chicken 3 but not 4. A "srfi-47" egg & support via the 
"array-lib" egg, which also provided SRFI 63. 

-57 available Chicken 3 but not 4.

-66 available Chicken 3 but not 4.

-72 available Chicken 3 but not 4. The "syntax-case" egg.

-85 available Chicken 3 but not 4.

> 
> 4. The SRFI-modules egg, at least according to its documentation at
> , neglects to provide an
> import library for SRFIs 61, 62, 88, yet these are part of my base
> install. Perhaps 46 also, though that came in a later version of Chicken
> than I have installed.

-61 would export `cond'?

-62 is a reader extension only. An empty module?

-88 is a reader extension. Could export the keyword?, etc. identifiers.

-46. An empty module?

> 
> Hope this is helpful.
> 
> -- 
> Jim Pryor
> prof...@jimpryor.net
> 
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users


___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Check for NULL struct



On Mar 29, 2011, at 9:46 AM, Cosme Enmanuel Zamudio Salazar wrote:

Is there a way to check for a NULL structure returned from a C  
function?


this is the structure

(define-record sdl-surface pointer)

(define-record-printer (sdl-surface s out)
  (for-each (lambda (x) (display x out))
(list "#")))

(define-foreign-type SDL_Surface (c-pointer "SDL_Surface")
  sdl-surface-pointer
  make-sdl-surface)


the NULL can be returned when i try to load an image that doesnt  
exists:


#;12> (img-load "test.png")
#

but how do i check if its NULL ?


The Chicken FFI maps a c-pointer NULL to #f as an argument & as a  
return value. The `pointer' field is #f above.


I must be missing something.



Thanks :)
___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users



___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Big Randoms



On Mar 10, 2011, at 8:56 PM, David N Murray wrote:


On Mar 10, Kon Lovett scribed:



What happens w/ 4.6.0 when you import 'numbers' into the toplevel?  
i.e.




#;1> (use numbers srfi-27)
#;2> (expt 2 32)
4294967296
#;3> (random-integer (expt 2 32))
Floating point exception

Same problem.  I'll go get 4.6.5 and try again.

Thanks Kon!


After responding I realized you are using 64-bit and I never updated  
the core generators (which are in C) to recognize 64-bit fixnums. I  
will look into this.


Sorry,
Kon



Dave




___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] Big Randoms



On Mar 10, 2011, at 7:26 PM, David N Murray wrote:


$ csi

CHICKEN
(c)2008-2010 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.6.0
macosx-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
compiled 2010-12-08 on sauron.local (Darwin)

#;1> (use srfi-27)
[snip loadings]
; loading /usr/local/lib/chicken/5/numbers.import.so ...
; loading /usr/local/lib/chicken/5/regex.import.so ...
; loading /usr/local/lib/chicken/5/srfi-27-numbers.import.so ...
; loading /usr/local/lib/chicken/5/srfi-27.so ...
[snip more loads]
; loading /usr/local/lib/chicken/5/numbers.so ...
; loading /usr/local/lib/chicken/5/srfi-27-numbers.so ...
[snip more loads]
#;2> (random-integer (expt 2 32))
Floating point exception
$

I'm working on a genetic algorithm framework and ran into this while
testing.  Is there something I'm missing, or should I be trying to
implement the dna handling in chunks of 31 bits? (random-integer  
(expt 2

31)) works fine.


Hi David,

I get the folllowing:

$ csi -n

CHICKEN
(c)2008-2011 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.6.5
macosx-unix-gnu-ppc [ manyargs dload ptables ]
compiled 2011-02-03 on Nikko.local (Darwin)

#;1> (use srfi-27)
; loading /usr/local/chicken/5/lib/chicken/6/srfi-27.import.so ...
; loading /usr/local/chicken/5/lib/chicken/6/scheme.import.so ...

; loading /usr/local/chicken/5/lib/chicken/6/srfi-4-checks.so ...
; loading /usr/local/chicken/5/lib/chicken/6/srfi-4-errors.so ...
#;2> (expt 2 32)
4294967296.0
#;3> (random-integer (expt 2 32))
3682515858.0

but notice that this is Chicken 4.6.5 & I do not have 4.6.0 installed  
so I cannot try it.


In reference to your question about "... chunks of 31 bits" 'random- 
integer ' accepts any exact integer in the full numeric tower as a  
bound.


What happens w/ 4.6.0 when you import 'numbers' into the toplevel? i.e.

(use numbers srfi-27)
(expt 2 32) ;=> ???
(random-integer (expt 2 32)) ;=> ???

Best Wishes,
Kon



TIA,
Dave

___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users



___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] SRFI-19 Error


Hello Thomas,

This is a bug. I will look into it. Sorry but thank you for reporting.

Kon

On Feb 1, 2011, at 5:03 PM, Thomas Hintz wrote:

Using csi and GNU readline (I don't think I'm doing anything  
wrong...):


#> (use srfi-19)
#> (date-subtract-duration (current-date) (make-duration days: 3))

Error: (+) bad argument type - not a number: #readline)">


Call history:

def-tt304312
srfi-19-date#default-date-clock-type
body302308
srfi-19-support#tm:date->time
srfi-19-support#tm:as-some-time
srfi-19-support#tm:subtract-duration
srfi-19-support#tm:date-timezone-info
srfi-19-date#tm:time->date/tzi
srfi-19-support#tm:time->date
locale-components#locale-components?

Another error:

#> (date-add-duration (current-date) (make-duration days: 3))
#,(date 31800 24 3 7 31 8 2020 -18000 EST #f #f #f #f)

This is not the correct date...

It doesn't seem to matter if I use make-date or current-date.  
current-date is:


#> (current-date)
#,(date -77800 55 0 20 1 2 2011 -18000 EST #f #f #f #f)

This is on Chicken 4.6.3 on Arch Linux i686.

If I'm doing something wrong, please let me know, otherwise I would  
be glad to help pin-point the bug.


Thanks,

Thomas Hintz
___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users



___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


  1   2   3   4   5   6   7   >