Re: Define in let

2013-08-21 Thread Dmitry Bogatov
>> It seems following is invalid: >> >>(let ((a 2)) >> (define (foo x) (+ a x))) >> >> I prefer to reduce scope of variable as much as possible, so >> I find this restriction unconvinent. Is is part of standard or technical >> limitation? Is it any workaround? > > Section '3.4.7 Exampl

Re: Define in let

2013-08-21 Thread Panicz Maciej Godek
2013/8/21 Ralf Mattes > On Wed, Aug 21, 2013 at 12:17:43PM +0200, Panicz Maciej Godek wrote: > > You're right, but it only works if you want to export only one symbol > > from a lexical scope. If you wanted a few procedures accessing > > a single scope, you'd either need to use the solution with

Re: Define in let

2013-08-21 Thread Ralf Mattes
On Wed, Aug 21, 2013 at 12:17:43PM +0200, Panicz Maciej Godek wrote: > You're right, but it only works if you want to export only one symbol > from a lexical scope. If you wanted a few procedures accessing > a single scope, you'd either need to use the solution with 'set!', > or -- as Taylan sugges

Re: Define in let

2013-08-21 Thread Panicz Maciej Godek
2013/8/21 Ralf Mattes > On Wed, Aug 21, 2013 at 08:52:02AM +0200, Panicz Maciej Godek wrote: > > 2013/8/20 David Pirotte > > > > > Hello, > > > > > > > It seems following is invalid: > > > > > > > >(let ((a 2)) > > > > (define (foo x) (+ a x))) > > > > > > > > I prefer to reduce scop

Re: Define in let

2013-08-21 Thread Ralf Mattes
On Wed, Aug 21, 2013 at 08:52:02AM +0200, Panicz Maciej Godek wrote: > 2013/8/20 David Pirotte > > > Hello, > > > > > It seems following is invalid: > > > > > >(let ((a 2)) > > > (define (foo x) (+ a x))) > > > > > > I prefer to reduce scope of variable as much as possible, so > > > I

Re: Define in let

2013-08-21 Thread Panicz Maciej Godek
2013/8/20 David Pirotte > Hello, > > > It seems following is invalid: > > > >(let ((a 2)) > > (define (foo x) (+ a x))) > > > > I prefer to reduce scope of variable as much as possible, so > > I find this restriction unconvinent. Is is part of standard or technical > > limitation? Is

Re: Define in let

2013-08-21 Thread Panicz Maciej Godek
Sorry, the macro definition relies on a few additional functions, in particular on the (ice-9 match) and (srfi srfi-1) modules and the following definitions: (define (split-before criterion list) (split-at list (or (list-index criterion list) (length list (define (equal

Re: Define in let

2013-08-20 Thread David Pirotte
Hello, > It seems following is invalid: > >(let ((a 2)) > (define (foo x) (+ a x))) > > I prefer to reduce scope of variable as much as possible, so > I find this restriction unconvinent. Is is part of standard or technical > limitation? Is it any workaround? Section '3.4.7 Example

Re: Define in let

2013-08-20 Thread John B. Brodie
On 08/20/2013 12:39 PM, Dmitry Bogatov wrote: > It seems following is invalid: > >(let ((a 2)) > (define (foo x) (+ a x))) > > I prefer to reduce scope of variable as much as possible, so > I find this restriction unconvinent. Is is part of standard or technical > limitation? Is it any

Re: Define in let

2013-08-20 Thread Mike Gran
> From: Dmitry Bogatov > It seems following is invalid: > >   (let ((a 2)) >         (define (foo x) (+ a x))) > Perhaps something like (let* ((a 2)    (foo (lambda (x) (+ a x   (foo -Mike

Re: Define in let

2013-08-20 Thread Ian Price
Dmitry Bogatov writes: > It seems following is invalid: > >(let ((a 2)) > (define (foo x) (+ a x))) > > I prefer to reduce scope of variable as much as possible, so > I find this restriction unconvinent. Is is part of standard or technical > limitation? Is it any workaround? It's not

Re: Define in let

2013-08-20 Thread Taylan Ulrich B.
Dmitry Bogatov writes: > It seems following is invalid: > >(let ((a 2)) > (define (foo x) (+ a x))) > > I prefer to reduce scope of variable as much as possible, so > I find this restriction unconvinent. Is is part of standard or technical > limitation? Is it any workaround? > > Pleas

Re: Define in let

2013-08-20 Thread Thompson, David
On Tue, Aug 20, 2013 at 12:39 PM, Dmitry Bogatov wrote: > > It seems following is invalid: > >(let ((a 2)) > (define (foo x) (+ a x))) > > I prefer to reduce scope of variable as much as possible, so > I find this restriction unconvinent. Is is part of standard or technical > limitati

Define in let

2013-08-20 Thread Dmitry Bogatov
It seems following is invalid: (let ((a 2)) (define (foo x) (+ a x))) I prefer to reduce scope of variable as much as possible, so I find this restriction unconvinent. Is is part of standard or technical limitation? Is it any workaround? Please, keep in CC, I am not subscribed. -- B