Re: How can I use arrows in csi?

2023-08-13 Thread Shawn Wagner
Install the breadline egg and set up your ~/.csirc per this example:
https://depp.brause.cc/breadline/examples/.csirc

On Sun, Aug 13, 2023, 5:42 AM Oskar Werner  wrote:

> Hi, when I want to use arrows to move back, my terminal instead produces
> ^[[D symbols, how can I get them to work? I installed chicken from arch
> extra repo and I tested this behavior using both fish shell and bash shell.
> Also everything works when I'm using python repl, so this problem with
> chicken-csi.
>


Re: Question about how to check a symbol is bound

2023-06-22 Thread Shawn Wagner
Looks like unbound? and symbol-value take quoted symbols if passing them
directly: And for list you have to use the transformed name scheme#list

#;2> (unbound? 'x)
#t
#;3> (define x 1)
#;4> (unbound? 'x)
#f
#;5> (symbol-value 'x)
1
#;6> (symbol-value 'scheme#list)
#

On Thu, Jun 22, 2023 at 10:15 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
>
> 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
>
> I expect (unbound? foo) will return True value, but it just throw
> exception.
>
> 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: srfi-tools egg

2023-04-25 Thread Shawn Wagner
On Tue, Apr 25, 2023, 5:37 AM Lassi Kortela  wrote:

> We now have an up-to-date .egg file for the `srfi` command line tool, a
> new program maintained by the SRFI Editor and volunteers to help run the
> SRFI process.
>
> ...
>
> Would it make sense to add this egg to the Chicken coop? We can write
> the requisite wiki page for it.
>

I was originally thinking about doing that, but since the srfi program
needs the greater srfi-common file tree it's part of to be present in
$SRFI_HOME to be able to run effectively, I changed my mind. Seemed easier
to just check out the repository into the right spot and run
chicken-install in it.


Re: New egg: srfi-227

2023-04-19 Thread Shawn Wagner
On Wed, Apr 19, 2023 at 2:11 PM Mario Domenech Goulart 
wrote:

> Hi Shawn,
>
[...]
>
> Some notes:
>
> * let-optionals is also provided by the chicken.base module
>
> * define-optionals is also provided by the miscmacros egg
>
> I haven't checked if the syntax/semantics are the same as the
> definitions of SRFI-227, though.
>
>
The version of let-optionals and let-optionals* in this SRFI is a superset
of the ones in (chicken base) - that one only accepts bindings with default
arguments, the SRFI includes mandatory and rest arguments too. AFAIK it's
backwards compatible with code using the chicken version.No idea about
miscmacros.


> Could you please add a link to the source repository to the
> egg documentation?
>

Updated the wiki documentation with a link and that it replaces those
macros from chicken base.


New egg: srfi-227

2023-04-19 Thread Shawn Wagner
Implementation of the given SRFI (Optional Arguments, for easier writing of
functions with, yes, optional arguments).

Release-info:
https://raw.githubusercontent.com/shawnw/chicken-srfi-227/master/srfi-227.release-info-5
Documentation: http://wiki.call-cc.org/eggref/5/srfi-227

test-new-egg report:

 srfi-227 (1 of 1) 
  Fetching[ ok ] 0s
  Reading .egg[ ok ] 0s
  Checking dependencies...[ ok ] 0s
  Checking category...[ ok ] 0s
  Checking license[ ok ] 0s
  Checking author.[ ok ] 0s
  Installing..[ ok ] 16s
  Checking version[ -- ]
  Testing.[ ok ] 11s
  Checking documentation..[ ok ] 1s
Removing /tmp/temp3b38.25779
Egg looks ok!


Re: [Chicken-users] CHICKEN 4.10.0 release candidate 1 available

2015-06-08 Thread Shawn Wagner
Operating system: NetBSD 6.1.5
Hardware: x86-64
C compiler: Tested using the system gcc (4.5.3), and clang 3.6.0.
Installation: Didn't check.
Tests work: Yes.
Installation of eggs: Didn't check.

Turning on address space randomization in the kernel will randomly
trigger illegal instruction errors in the test programs. I'll try to
check OpenBSD in the next couple of days to see if it has the same
issue, since I think Open, unlike Net, has its implementation of ASLR
turned on by default.



On Sun, 07 Jun 2015 17:16:07 +0200
Moritz Heidkamp mor...@twoticketsplease.de wrote:

 Hello everyone,
 
 we are happy to announce the first release candidate of the upcoming
 CHICKEN 4.10.0. It is now available at this location:
 
 http://code.call-cc.org/dev-snapshots/2015/06/07/chicken-4.10.0rc1.tar.gz
 
 The SHA 256 sum of that tarball is
 
 b5cc7c2d270d11f56a52da1b78950ada27d9bce2496b8ba230542d104b5477f0
 
 The list of changes since version 4.9.0 is available here:
 
 http://code.call-cc.org/dev-snapshots/2015/06/07/NEWS
 
 Please give it a test and report your findings to the mailing list.
 

-- 
Shawn Wagner
sha...@speakeasy.org


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


Re: [Chicken-users] Idiomatic way to access nth element of a list

2014-12-14 Thread Shawn Wagner
list-ref

On Sun, 14 Dec 2014 20:08:09 +0330
Bahman Movaqar bah...@bahmanm.com wrote:

 How would a seasoned Schemer access the nth element of a list? (drop)?
 Does it have any performance penalty?
 
 TIA,
 


-- 
Shawn Wagner
sha...@speakeasy.org


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


Re: [Chicken-users] how to speed up my text filter?

2013-09-24 Thread Shawn Wagner
Increasing the initial heap size to something big enough it doesn't need
to do much or any GC (Something like csc -:hi500M -:hs0 foo.scm) might
help.

On Tue, 24 Sep 2013 18:35:10 -0400

Xin Zheng spiralzh...@gmail.com wrote:

 Hi all,
 
 I am a newbie to Chicken Scheme. Use compiled following filter, I am
 trying to filter a text file with 1 million lines. It took 10
 seconds, while profiling showed that 90% time used on GC. I am
 wondering if any way to speed it up.
 
 Any help would be appreciated.
 
 Thanks,
 Zin
 
 
 (use chicken extras)
 (define args ( argv))
 (define f (list-ref args 1))
 (define in (open-input-file f))
 (define out (open-output-file (list-ref args 2)) )
 
 (define (process line)
   (if (eq? #\@ (string-ref line 0))
   '()
   (let* ([eles (string-split line \t)]
  [ref (list-ref eles 2)]
  [id (list-ref eles 0)])
 (if (eq? (string-ref ref 0) #\*)
 (write-line id out)
 
 (let loop ([l (read-line in)])
   (if (eof-object? l)
   (write-line done (current-error-port))
   (begin (process l)
  (loop (read-line in)
 
 (close-input-port in)
 (close-output-port out)


-- 
Shawn Wagner
sha...@speakeasy.org


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