‘with-exception-handler’ rationale

2014-03-07 Thread Nikita Karetnikov
I’ve expected ‘with-exception-handler’ to behave like ‘catch’, but it doesn’t. scheme@(guile-user)> ,use (srfi srfi-34) scheme@(guile-user)> (with-exception-handler (const "got it") (lambda () (raise "boom!"))) ice-9/boot-9.scm:106:20: In procedure #: ice-9/boot-9.scm:106:20: Throw to key `srfi-3

Re: GNU Guix hackathon on Sep. 28-29

2013-09-24 Thread Nikita Karetnikov
> I will be physically present at the hackathon in Cambridge. Most Guix developers are not in the US, but it would be great if you could find interested people in Cambridge. > I have experience with Guile, but I haven't done much work with package > management systems before. That’s not a proble

Re: On procedures within procedures

2013-04-04 Thread Nikita Karetnikov
> One could look at using lots of procedures within procedures as good > defensive programming style: hiding unnecessary functions. Here is a related part of SICP [1] which describes this approach. [1] https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1.8 (Internal definition

Safe pattern matching

2013-02-09 Thread Nikita Karetnikov
Any Haskellers here? How would you rewrite the following function in Guile? foo :: [Int] -> String -> [Int] foo (x:y:ys) "+" = (x + y):ys foo (x:y:ys) "-" = (x - y):ys foo xs num = read num:xs *Main> foo [] "42" [42] *Main> foo [1,2] "42" [42,1,2] *Main> foo [1,2] "+" [3] *Main> foo [1..10

Re: GNU Guile community in google+

2013-01-15 Thread Nikita Karetnikov
Hi, This thread misses the point. Because there are two separate issues: 1. Is it OK to use non-free and centralized services? I'm not going to explain why it's not OK in detail. But I'd like to point out that if you use such a service, you encourage others to do the same. Here is an example:

SRFI-37: option

2012-12-25 Thread Nikita Karetnikov
Hello, I have some questions about the '%options' variable. [1] 1. According to the documentation, 'option' accepts four arguments: 'names', 'required-arg?', 'optional-arg?', 'processor' and "processor is a procedure that takes at least 3 arguments..." [2] So why do some options (e.g.,