Puzzle

From: Wolfgang Lux <lux_at_helios.uni-muenster.de>
Date: Tue, 01 Dec 1998 14:42:08 +0000

Hello,

here is a little puzzle concerning the semantics given to local variables in the latest Curry report.

Consider the following definitions:

  incr x = x + 1
  decr x = x - 1

  f1 x = g (g x)
         where g = incr
               g = decr

  f2 h1 h2 x = g (g x)
               where g = h1
                     g = h2

  f3 h1 h2 h3 x = h3 g g x
                  where g = h1
                        g = h2

The question is, what are the results of

1) f1 3
2) f2 incr decr 3
3) f3 incr decr (.) 3

Regards
Wolfgang
Received on Di Dez 01 1998 - 14:52:00 CET

This archive was generated by hypermail 2.3.0 : Do Feb 01 2024 - 07:15:05 CET