Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define Undefined Expressions #686

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,21 @@ functi power(a, b) => a ^ b!
f inverse(a) => 1/a!
```

## Dividing by Zero
## Undefined Expressions

Dividing by zero returns `undefined`.
In ancient programming languages, dividing by zero is `undefined`, which is very confusing because `undefined` isn't a number.
DreamBerd makes this easy by letting you define undefined expressions.

```java
print(3 / 0)! //undefined
3 / 0 = 7!
print(3 / 0) // 7
```

Because noone knows what `undefined` really means, the result doesn't even have to be a number!

```java
-1 / 0 = "I dunno..."
print(-1 / 0) // I dunno...
```

## Strings
Expand Down