-
Notifications
You must be signed in to change notification settings - Fork 0
inventions
Not new inventions, but cherry-picking the most beautiful, powerful and sane features of other modern programming languages, especially Julia, Swift, Crystal and Kotlin but definitely not Java. Those adoptions include it keyword in closures, multiple dispatch, optional typing, self hosting (secondary goal to not bias language design)
The it keyword in closures was a great invention ( first seen in Kotlin?) we extend this to much wider user cases, in fact it becomes the catch all keyword for the current object, variable or result; where Julia has ans etc.
square of number = it*it
Often it is identical to this/self unless there is another object in scope, in which this/self are to be used. What might seem slightly complicated comes very naturally when applied.
'to' keyword to define verb functions
To square a number: return it times it
Inverse dot: a.b is b of a
Also works in assignments and definitions:
square of number = it*it
In fact this is the preferred way to define property methods out of scope. In scope it would look like this:
Number {
Square = it*it
}
To square a number: return it times it
3.squ<tab>
3.square is 9
To square a number: return it times it
x is number 3
square of <tab>
square of x is 9
Merge the concept of type and variable (name) in simple functions:
To assign a photo to a contact:
contact.image = photo
Reserve all pronouns propositions and particles as Keywords Once a word is defined as class it becomes a semi keyword in that properties/methods get assigned to the class:
Integers are numbers
Number a = 3
square of number = it*it
Colors = red, green, blue
Color#1 is red