From a79e0e734113a0d29f064fc8fb2ae7258e246e55 Mon Sep 17 00:00:00 2001 From: jim Date: Fri, 6 Feb 2015 10:08:16 -0500 Subject: [PATCH] add anchor for #lightweight --- topics/week1.mdwn | 1 + 1 file changed, 1 insertion(+) diff --git a/topics/week1.mdwn b/topics/week1.mdwn index f47cd857..52299d12 100644 --- a/topics/week1.mdwn +++ b/topics/week1.mdwn @@ -276,6 +276,7 @@ Now whereas sequences expect homogenously-typed elements, and their length is ir did. They need not, but they may. Also, the type of a multivalue or tuple does depend on its length, and moreover on the specific types of each of its elements. A tuple of length 2 (also called a "pair") whose first element is a number and second element is a boolean is a different type of thing that a tuple whose first element is a boolean and whose second element is a number. Most functions expecting the first as an argument will "crash" if you give them the second instead. + Earlier I said that we can call these things "multivalues or tuples". Here I'll make a technical comment, that in fact I'll understand these slightly differently. Really I'll understand the bare expression `(10, x)` to express a multivalue, and to express a tuple proper, you'll have to write `Pair (10, x)` or something like that. The difference between these is that only the tuple proper is a single value that can be bound to a single variable. The multivalue isn't a single value at all, but rather a plurality of values. This is a bit subtle, and other languages we're looking at this term don't always make this distinction. But the result is that they have to say complicated things elsewhere. If we permit ourselves this fine distinction here, many other things downstream will go more smoothly than they do in the languages that don't make it. Ours is just a made-up language, but I've thought this through carefully, so humor me. We haven't yet introduced the apparatus to make sense of expressions like `Pair (10, x)`, so for the time being I'll just restrict myself to multivalues, not to tuples proper. The result will be that while we can say: let x be [10, 20] in ... -- 2.11.0