Nп/п : 48 из 93
 От   : none) (albert                       2:5075/128        27 авг 23 13:12:40
 К    : Kaz Kylheku                                           27 авг 23 14:14:04
 Тема : Re: MAL : closures and recursion
----------------------------------------------------------------------------------
                                                                                 
@MSGID:
aa1f1af4
@REPLY: <20230826125020.141@kylheku.com> eeb482f5
@REPLYADDR none) (albert
@REPLYTO 2:5075/128 none) (albert
@CHRS: CP866 2
@RFC: 1 0
@RFC-References:
<20230819073816.564@kylheku.com>
<20230826125020.141@kylheku.com>
@RFC-Message-ID:

@TZUTC: 0200
@TID: FIDOGATE-5.12-ge4e8b94
In article <20230826125020.141@kylheku.com>,
Kaz Kylheku  <864-117-4973@kylheku.com> wrote:
>On 2023-08-26, albert@cherry.(none) (albert)  wrote:
>> I tested it, and my implementation fails the dynamic scope test.
>> But what is supposed to happen if `a is global (pervasive environment)
>> here?
>>
>> (define a 12)
>> (define fun () a)
>> (define a 13)
>> (fun)
>
>If there is a top-level environment like in Common Lisp, then the
>second definition of a is actually an assignment.
>
>If there is a top-level lexical scope, then the second a is a new
>lexical identifier unrelated to the first a, and so fun refers
>to the 12 not the 13.
>
>This is a just a matter of knowing the requirements in MAL.

That is far as you can help me. Unfortunately there is no
requirements for MAL, only an implementation model.
The descriptions are very lispy, and my implementation language
is totally different. But that was the point of this exercise
anyway. Thanks anyway.

I like the explanation of lisp concepts on this website "lisp from
nothing", but it is not much help in implementing them.
https://www.t3x.org/lfn/index.html

>Mastodon: @Kazinator@mstdn.ca

Groetjes Albert
-- 
Don`t praise the day before the evening. One swallow doesn`t make spring.
You must not say "hey" before you have crossed the bridge. Don`t sell the
hide of the bear until you shot it. Better one bird in the hand than ten in
the air. First gain is a cat spinning.            - the Wise from Antrim -
--- trn 4.0-test77 (Sep 1, 2010)
 * Origin: KPN B.V. (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх