Dotted values
-
Douglas Creager
- Assigned user set to Douglas Creager
-
Douglas Creager
- Title changed from Dotted channels to Dotted values
It's actually dotted values that aren't supported. For instance, the following is a perfectly valid CSPM expression:
1.2It's the dot of two numbers. That doesn't involve channels or events in any way. Dotted values will also come into play with
datatypestatements (part of ticket #17 nametype definitions) and channels that carry data (what this ticket originally called “dotted channels”). -
Douglas Creager
- State changed from new to open
-
Douglas Creager
- Milestone set to 1.0-α4
-
Douglas Creager
(from [a086a735566dd10bebe7f0d85ccb209242c06317]) Dotted values
This patch introduces basic support for dotted values. A dotted value is similar to a tuple:
1.2 (1,2)
However, dots support concatenation:
x = 1.2 y = 3.4 x.y == 1.2.3.4
The CSPM parser now allows you to construct dotted values using the “.” operator. We still need to add support for dotted values in patterns and type expressions.
Lighthouse: [#15 Dotted values] http://github.com/hst/hst/commit...
-
Douglas Creager
(from [a086a735566dd10bebe7f0d85ccb209242c06317]) Dotted values
This patch introduces basic support for dotted values. A dotted value is similar to a tuple:
1.2 (1,2)
However, dots support concatenation:
x = 1.2 y = 3.4 x.y == 1.2.3.4
The CSPM parser now allows you to construct dotted values using the “.” operator. We still need to add support for dotted values in patterns and type expressions.
Lighthouse: [#15 Dotted values] http://github.com/hst/hst/commit...
-
Douglas Creager
(from [624f65caa7bc15a6281e6df7ece2d90bca9ed279]) Dotted values in “nametype” statements
Dotted values in a type expression create product types, just like tuple values:
nametype A = {0,1}.{2,3} A == {0.2, 0.3, 1.2, 1.3}
Lighthouse: [#15 Dotted values] http://github.com/hst/hst/commit...
-
Douglas Creager
(from [624f65caa7bc15a6281e6df7ece2d90bca9ed279]) Dotted values in “nametype” statements
Dotted values in a type expression create product types, just like tuple values:
nametype A = {0,1}.{2,3} A == {0.2, 0.3, 1.2, 1.3}
Lighthouse: [#15 Dotted values] http://github.com/hst/hst/commit...
-
Douglas Creager
- State changed from open to resolved
(from [0dcc09f518d1117c73122ed5b0466a3d4fc159bb]) Dotted values in patterns
Dotted values can occur in a pattern, such as in the parameters to a named function:
f(a.b) = a + b
Based on some experimentation, it turns out that the left-hand side of a dotted pattern must match the first element of a dotted value. The right-hand side must match the “rest” of the dotted value. If the dotted value only contains two elements, then that means it must match the second element. If it contains more than two elements, then that means it must match a slightly smaller dotted value:
a.b matches 1.2 (a == 1, b == 2) a.b matches 1.2.3 (a == 1, b == 2.3) a.b.c matches 1.2.3 (a == 1, b == 2, c = 3) 1.b matches 1.2.3 (b == 2.3) a.3 DOES NOT MATCH 1.2.3 (a == 1, but 3 doesn't match 2.3)
Lighthouse: [#15 Dotted values state:resolved] http://github.com/hst/hst/commit...
-
Douglas Creager
(from [0dcc09f518d1117c73122ed5b0466a3d4fc159bb]) Dotted values in patterns
Dotted values can occur in a pattern, such as in the parameters to a named function:
f(a.b) = a + b
Based on some experimentation, it turns out that the left-hand side of a dotted pattern must match the first element of a dotted value. The right-hand side must match the “rest” of the dotted value. If the dotted value only contains two elements, then that means it must match the second element. If it contains more than two elements, then that means it must match a slightly smaller dotted value:
a.b matches 1.2 (a == 1, b == 2) a.b matches 1.2.3 (a == 1, b == 2.3) a.b.c matches 1.2.3 (a == 1, b == 2, c = 3) 1.b matches 1.2.3 (b == 2.3) a.3 DOES NOT MATCH 1.2.3 (a == 1, but 3 doesn't match 2.3)
Lighthouse: [#15 Dotted values state:resolved] http://github.com/hst/hst/commit...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.