Skip to content

Commit

Permalink
feat: lowercase ln in print
Browse files Browse the repository at this point in the history
  • Loading branch information
pmqueiroz committed Dec 1, 2024
1 parent 5cdea0a commit f92d179
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/docs/examples/hello-word.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This example demonstrates how to print a message to the terminal using the Umbra
```u title="hello-world.u" hl_lines="3"
import "io"
io::printLn("Hello world")
io::println("Hello world")
```

### How to Run
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/examples/loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The initialized `for` loop has an initializer, stop condition, and an optional s

```u title="loops.u"
for mut i num = 0, 10, 2 {
io::printLn(i)
io::println(i)
}
```
where `i` starts at `0`, runs until `10`, and increments by `2` on each iteration, resulting in
Expand Down Expand Up @@ -57,7 +57,7 @@ for mut i num = 0, 100 {
break
}
io::printLn(i)
io::println(i)
}
```

Expand Down
12 changes: 6 additions & 6 deletions docs/docs/examples/values.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ Umbra has various value types including strings (`str`), numbers (`num`), boolea
Strings, which can be added together with +.

```u title="values.u"
io::printLn("umbra" + "lang")
io::println("umbra" + "lang")
```
Numbers.

```u title="values.u"
io::printLn("1+1 =", 1+1)
io::printLn("7/3 =", 7/3)
io::println("1+1 =", 1+1)
io::println("7/3 =", 7/3)
```

Booleans, with boolean operators as you’d expect.

```u title="values.u"
io::printLn(true and false)
io::printLn(true or false)
io::printLn(!true)
io::println(true and false)
io::println(true or false)
io::println(!true)
```

```sh
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/libs/io.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Prints the provided values to the standard output without a newline at the end.
- **Parameters:**
- `values`: A variadic parameter of any type, representing the values to be printed.

### `printLn(values ...any)`
### `println(values ...any)`

Prints the provided values to the standard output with a space between each value and a newline at the end.

Expand Down
6 changes: 3 additions & 3 deletions examples/enums.u
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ const events arr = [
for mut i num = 0, ~events - 1 {
match events[i] {
Event.Keyboard |key| {
io::printLn("keyboard event with key:", key)
io::println("keyboard event with key:", key)
}
Event.Click |x, y| {
io::printLn("click event at x:", x, "y:", y)
io::println("click event at x:", x, "y:", y)
}
Event.Close {
io::printLn("close event")
io::println("close event")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/fibonacci-iterator.u
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ def fibonacci(n num) num {
return b
}

io::printLn(fibonacci(47))
io::println(fibonacci(47))
2 changes: 1 addition & 1 deletion examples/fibonacci.u
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ def fib(n num) num {

# i do not recommend going above 38
# unless you want to wait a while
io::printLn(fib(38))
io::println(fib(38))
4 changes: 2 additions & 2 deletions examples/invert-binary-tree.u
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ def invertTree(root hashmap?) {
return root
}

io::printLn("original:")
io::println("original:")

printTree(binaryTree)

invertTree(binaryTree)

io::printLn("\ninverted:")
io::println("\ninverted:")

printTree(binaryTree)
4 changes: 2 additions & 2 deletions examples/size.u
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "io"

io::printLn(~[0, 1, 2])
io::printLn(~"string")
io::println(~[0, 1, 2])
io::println(~"string")
6 changes: 3 additions & 3 deletions lib/io.u
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def printErr(values ...any) {
}
}

def printErrLn(values ...any) {
def printErrln(values ...any) {
for mut i num = 0, ~values - 1 {
stdout values[i]
if (i != ~values - 1) {
Expand All @@ -34,7 +34,7 @@ def printErrLn(values ...any) {

pub {
print
printLn
println
printErr
printErrLn
printErrln
}

0 comments on commit f92d179

Please sign in to comment.