public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* learning scheme : difference in letrec behavior
@ 2015-11-03  2:42 Debabrata Pani
  2015-11-03  2:53 ` Per Bothner
  0 siblings, 1 reply; 4+ messages in thread
From: Debabrata Pani @ 2015-11-03  2:42 UTC (permalink / raw)
  To: kawa

In kawa (2.1 , 2.0) ,
the expression and its result

#|kawa:27|# (letrec ((x 1) (y (+ x 2))) (+ y x))
4
#|kawa:28|#

But the above expression fails in chicken/gambit
gsi error message
*** ERROR IN (console)@1.19 -- (Argument 1) NUMBER expected
(+ #!unbound 2)

from my point of view , this is harmless. And probably portability
with other scheme implementations is not my concern as well.

But will this have any other unwarranted impact ?

Regards,
Debabrata Pani

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: learning scheme : difference in letrec behavior
  2015-11-03  2:42 learning scheme : difference in letrec behavior Debabrata Pani
@ 2015-11-03  2:53 ` Per Bothner
  2015-11-03  2:55   ` Per Bothner
  0 siblings, 1 reply; 4+ messages in thread
From: Per Bothner @ 2015-11-03  2:53 UTC (permalink / raw)
  To: Debabrata Pani, kawa



On 11/02/2015 06:42 PM, Debabrata Pani wrote:
> In kawa (2.1 , 2.0) ,
> the expression and its result
>
> #|kawa:27|# (letrec ((x 1) (y (+ x 2))) (+ y x))
> 4
> #|kawa:28|#
>
> But the above expression fails in chicken/gambit
> gsi error message
> *** ERROR IN (console)@1.19 -- (Argument 1) NUMBER expected
> (+ #!unbound 2)
>
> from my point of view , this is harmless. And probably portability
> with other scheme implementations is not my concern as well.

Kawa basically implements 'letrec' as if it were 'letrec*'.
I.e. it evaluates the init expressions in order, while R7RS
makes it unspecified.  This is allowed as an implementation
dependency.

> But will this have any other unwarranted impact ?

Only that you depend on Kawa-specific unportable semantics.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: learning scheme : difference in letrec behavior
  2015-11-03  2:53 ` Per Bothner
@ 2015-11-03  2:55   ` Per Bothner
  2015-11-03  4:41     ` Debabrata Pani
  0 siblings, 1 reply; 4+ messages in thread
From: Per Bothner @ 2015-11-03  2:55 UTC (permalink / raw)
  To: Debabrata Pani, kawa

On 11/02/2015 06:52 PM, Per Bothner wrote:

> Kawa basically implements 'letrec' as if it were 'letrec*'.
> I.e. it evaluates the init expressions in order, while R7RS
> makes it unspecified.  This is allowed as an implementation
> dependency.

This is actually covered in the Kawa manual:

http://www.gnu.org/software/kawa/Local-binding-constructs.html
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: learning scheme : difference in letrec behavior
  2015-11-03  2:55   ` Per Bothner
@ 2015-11-03  4:41     ` Debabrata Pani
  0 siblings, 0 replies; 4+ messages in thread
From: Debabrata Pani @ 2015-11-03  4:41 UTC (permalink / raw)
  To: Per Bothner; +Cc: kawa

Hi Per,

my bad that I did not refer to the *let* documentation in kawa.

But your explanation regarding R7RS spec was  important for me.

Regards,
Debabrata Pani

On Tue, Nov 3, 2015 at 8:25 AM, Per Bothner <per@bothner.com> wrote:
> On 11/02/2015 06:52 PM, Per Bothner wrote:
>
>> Kawa basically implements 'letrec' as if it were 'letrec*'.
>> I.e. it evaluates the init expressions in order, while R7RS
>> makes it unspecified.  This is allowed as an implementation
>> dependency.
>
>
> This is actually covered in the Kawa manual:
>
> http://www.gnu.org/software/kawa/Local-binding-constructs.html
>
> --
>         --Per Bothner
> per@bothner.com   http://per.bothner.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-03  4:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-03  2:42 learning scheme : difference in letrec behavior Debabrata Pani
2015-11-03  2:53 ` Per Bothner
2015-11-03  2:55   ` Per Bothner
2015-11-03  4:41     ` Debabrata Pani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).