Skip to content
pannous edited this page Nov 18, 2020 · 34 revisions

resolution: interactive

Ambiguity should ideally be resolved by the compiler by asking questions.

a {x=1} Did you mean a:{x=1} or [a,{x=1}] ?

resolution: braces

One way to resolve ambiguities us by inserting braces

square 3 + 4 times 3
square(3 + (4 times 3))

Even though there might not be an ambiguity to the compiler, it can be helpful to insert braces to make it easier for the user to parse the meaning: a or b and c => a or (b and c)

The reasoning behind this is that the developer might not always we be aware of the function operator precedence.

ambiguous references

ambiguous it keyword

In lambda expressions, the it keyword refers to the first (implicit argument), otherwise it refers to self or the last result, which can be very ambivalent:

double=it*2 # ok, [evaluate](evaluation) immediately?
double:it*2 # may evaluate to anything later
double:=it*2 # ok, implicit argument for function 'double'

functions or functors

map [1 2 3] square could be read as map [1 2 3] :square symbolic function pointer map ([1 2 3] square) == map [1 4 9] The last interpretation makes no sense just be sure to test that it never happens

variables vs functions

ambiguous assignment concepts:

name, age, source = "Crystal, 123, GitHub".split(", ")
name age, source := "Crystal, 123, GitHub".split(", ")

Home

Philosophy

data & code blocks

features

inventions

evaluation

keywords

iteration

tasks

examples

todo : bad ideas and open questions

⚠️ specification and progress are out of sync

Clone this wiki locally