TodePond / DreamBerd

perfect programming language
https://dreamberd.computer
Other
10.62k stars 299 forks source link

Add a `was` keyword #666

Open kokoro-aya opened 4 days ago

kokoro-aya commented 4 days ago

Some languages have is keyword for various purposes, for example, Python uses it to check the equality between objects and Kotlin uses it to verify if a value appears to a given type.

Considering the ability of time traveling in DreamBerd, maybe it's useful to introduce a variant like was, for example, to check something happened in the past? Similarly, a will be keyword could be exploited to do something in the future.

Some simple examples:


const var score = 5!
score++!
print(score was 5)! // true

addEventListener("click", () => score++)!
print(await (score will be 7))! // true
print(score )! //5

Meanwhile, other variants like were, wasn't, weren't, would or has been could also be considered for adding interesting features.