[Chicken-users] unbound variable: or

2015-05-27 Thread Jinsong Liang
Hi, In Chicken, (apply + '(1 2)) returns 3, which is expected. However, if I try: (apply or '(#t #f)) Error: unbound variable: or Why (apply or '(#t #f)) does not work? Thank you! Jinsong ___ Chicken-users mailing list Chicken-users@nongnu.org

Re: [Chicken-users] unbound variable: or

2015-05-27 Thread Daniel Leslie
'or' is a macro, and macros cannot be used as the first operand in apply. -Dan On Wed, May 27, 2015 at 1:25 PM, Jinsong Liang jinsongli...@gmail.com wrote: Hi, In Chicken, (apply + '(1 2)) returns 3, which is expected. However, if I try: (apply or '(#t #f)) Error: unbound variable: or

Re: [Chicken-users] unbound variable: or

2015-05-27 Thread Peter Bex
On Wed, May 27, 2015 at 08:34:12PM +, Mario Domenech Goulart wrote: On Wed, 27 May 2015 16:25:33 -0400 Jinsong Liang jinsongli...@gmail.com wrote: In Chicken, (apply + '(1 2)) returns 3, which is expected. However, if I try: (apply or '(#t #f)) Error: unbound variable: or

Re: [Chicken-users] unbound variable: or

2015-05-27 Thread Peter Danenberg
Quoth Peter Bex on Boomtime, the 1st of Confusion: If or were a simple procedure, it would first evaluate all its arguments and then call the procedure. This is also known as applicative vs. normal order; see e.g.: https://mitpress.mit.edu/sicp/full-text/sicp/book/node85.html Procedures are

Re: [Chicken-users] unbound variable: or

2015-05-27 Thread Mario Domenech Goulart
Hi Jinsong, On Wed, 27 May 2015 16:25:33 -0400 Jinsong Liang jinsongli...@gmail.com wrote: In Chicken, (apply + '(1 2)) returns 3, which is expected. However, if I try: (apply or '(#t #f)) Error: unbound variable: or Why (apply or '(#t #f)) does not work? Welcome! `or' (*) is not a

Re: [Chicken-users] unbound variable: or

2015-05-27 Thread Jinsong Liang
Hi, Thanks a lot for all of your replies! Then is there a straightforward way to get a list of booleans ored? I tried fold with or but it does not work either. It seems writing a loop or a recursion for this is a little overkill. Jinsong On Wed, May 27, 2015 at 4:54 PM, Peter Bex

Re: [Chicken-users] unbound variable: or

2015-05-27 Thread Jinsong Liang
Thank you! That solved my problem! Jinsong On Wed, May 27, 2015 at 7:53 PM, John Cowan co...@mercury.ccil.org wrote: Jinsong Liang scripsit: Then is there a straightforward way to get a list of booleans ored? I tried fold with or but it does not work either. It seems writing a loop or

[Chicken-users] Mutual recursion w/ comparse

2015-05-27 Thread Matt Gushee
Hello-- I'm trying to write my first real parser with comparse, but I'm running into some difficulty with mutual recursion. Here's the problematic portion of my code: (define-values (dict dict-content dict-entry dict-value) (let () (define dict~ (enclosed-by (is #\{)

Re: [Chicken-users] unbound variable: or

2015-05-27 Thread John Cowan
Jinsong Liang scripsit: Then is there a straightforward way to get a list of booleans ored? I tried fold with or but it does not work either. It seems writing a loop or a recursion for this is a little overkill. You want any. -- John Cowan http://www.ccil.org/~cowan

Re: [Chicken-users] unbound variable: or

2015-05-27 Thread Matt Gushee
On Wed, May 27, 2015 at 3:46 PM, Peter Danenberg p...@roxygen.org wrote: Quoth Peter Bex on Boomtime, the 1st of Confusion: If or were a simple procedure, it would first evaluate all its arguments and then call the procedure. This is also known as applicative vs. normal order; see e.g.:

[Chicken-users] u8vector to numbers bignum

2015-05-27 Thread chi
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. Logically I can't imagine a bignum isn't represented under the hood by a block