Re: SRFI 182: ADBMAL, ALET, and ALET* Joo ChurlSoo (11 Mar 2020 04:52 UTC)
Re: SRFI 182: ADBMAL, ALET, and ALET* Marc Feeley (11 Mar 2020 14:01 UTC)
Re: SRFI 182: ADBMAL, ALET, and ALET* Joo ChurlSoo (11 Mar 2020 23:50 UTC)

Re: SRFI 182: ADBMAL, ALET, and ALET* Joo ChurlSoo 11 Mar 2020 23:50 UTC

 * From: Marc Feeley <xxxxxx@iro.umontreal.ca>
 * Date: Wed, 11 Mar 2020 10:01:35 -0400
 * Subj: Re: SRFI 182: ADBMAL, ALET, and ALET*

    >> On Mar 11, 2020, at 12:52 AM, Joo ChurlSoo <xxxxxx@gmail.com> wrote:
    >>
    >>
    >> | For example:
    >> | (define x 1)
    >> | (define y 2)
    >> | (define a (adbmal x y))
    >> | (define a* (adbmal* x y))
    >> | (define v (values x y))		error:racket
    >> | (define v* (lambda () (values x y)))
    >> | (define listxy (lambda (x y) (list x y)))
    >>
    >> | (a listxy)        	       	= (1 2)
    >> | (a* listxy)      	      	= (1 2)
    >> | (call-with-values v listxy)  	error
    >> | (call-with-values v* listxy)    = (1 2)
    >> | (receive (x y) v (list x y))	error or (1 2):gambit
    >> | (receive (x y) v* (list x y))	error
    >> | (receive (x y) (v*) (list x y)) = (1 2)
    >>
    >> | (set! x 10)
    >> | (set! y 20)
    >> | (a listxy)	       	       	= (10 20)
    >> | (a* listxy)      	      	= (1 2)
    >> | (call-with-values v* listxy)    = (10 20)
    >> | (receive (x y) (v*) (list x y)) = (10 20)
    >> | (receive (x y) v (list x y))	error or (1 2):gambit
    >>
    >> By the way, which do you think is correct, racket or gambit?

 | Actually both…

I also think so.

In fact, there is one more group besides the two groups.
And from a perspective of consistency, all three groups would be correct.

1. (define v (values x y))
2. (receive (x y) v (list x y))

Group A. 1: error, 2: error
Group B. 1: pass,  2: pass
Group C. 1: pass,  2: error

Group A: Needless to say, consistency is maintained.
Group B: Consistency is maintained, because `v' is included in lambda in almost
      	 all cases. And most of all, this group has a responsible attitude for
      	 their actions.
Group C: It may not be understood in some ways, but it is understood to be for
      	 consistency.

--
Joo ChurlSoo