Re: [Chicken-hackers] Patch to use better PRNG on BSD's

2012-04-14 Thread Aleksej Saushev
  Hello!

Timo Myyrä timo.my...@gmail.com writes:

 I noticed that chicken uses old rand / srand functions when better
 alternatives are present.
 Patch makes BSD's use arc4random instead of rand.

Any BSD has libcrypto at least, and I think each one has strong
RNG implementation, e.g. rnd(4) in NetBSD, random(4) in FreeBSD.

I find using arc4random(3) as a replacement to traditional rand(3) stupid.
What is the point of it? If you need PRNG with better statistical properties,
then RC4 isn't satisfyingly better than LCG.


-- 
HE CE3OH...


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


[Chicken-hackers] [PATCH] Correct the types.db entry for `eval'

2012-04-14 Thread Moritz Heidkamp
Hello Chicken friends,

the attached patch corrects the types.db entry for the `eval' function
to allow multiple return values. I also added some tests to
library-tests.scm for a lack of more suitable better place.

Moritz
From 3ad6146e9b9e87c43f37ae511f025be2af117f0d Mon Sep 17 00:00:00 2001
From: Moritz Heidkamp mor...@twoticketsplease.de
Date: Sat, 14 Apr 2012 20:37:06 +0200
Subject: [PATCH] Correct the types.db entry for `eval' to allow multiple
 return values.

---
 tests/library-tests.scm |6 ++
 types.db|2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/library-tests.scm b/tests/library-tests.scm
index f133f3f..1268bd4 100644
--- a/tests/library-tests.scm
+++ b/tests/library-tests.scm
@@ -278,3 +278,9 @@
 
 (assert-fail (make-blob -1))
 (assert-fail (make-vector -1))
+
+;;; eval return values
+
+(assert (= 1 (eval 1)))
+(assert (eq? '() (receive (eval '(values)
+(assert (equal? '(1 2 3) (receive (eval '(values 1 2 3)
diff --git a/types.db b/types.db
index be90225..7aed56f 100644
--- a/types.db
+++ b/types.db
@@ -659,7 +659,7 @@
 			 (let ((#(tmp2) #(2)))
 			   (#(tmp2) (#(tmp1)))
 
-(eval (procedure eval (* #!optional (struct environment)) *))
+(eval (procedure eval (* #!optional (struct environment)) . *))
 (char-ready? (#(procedure #:enforce) char-ready? (#!optional input-port) boolean))
 
 (imag-part (#(procedure #:clean #:enforce) imag-part (number) number)
-- 
1.7.9.4

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