Skip to content

Commit

Permalink
update std
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Sep 11, 2023
1 parent d0cef3d commit 3a2c914
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 3 deletions.
34 changes: 31 additions & 3 deletions src/standard-library/std-fmt.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,47 @@ And does not increase argument list offset.
```jule
fn printf(fmt: str, args: ...any)
```
Prints result of formatting. See documentation of format function for formatting.
Prints result of formatting to stdout. See documentation of format function for formatting.

---

```jule
fn print(args: ...any)
```
Prints arguments by default formatting.
Prints arguments by default formatting to stdout.

---

```jule
fn println(args: ...any)
```
Prints arguments by default formatting.
Prints arguments by default formatting to stdout.
Prints new-line after arguments.

---

```jule
fn fprint(mut f: &File, args: ...any)
```
Prints arguments to file by default formatting. See documentation of format function for formatting.

---

```jule
fn fprintln(mut f: &File, args: ...any)
```
Prints arguments to file by default formatting. Prints new-line after arguments. See documentation of format function for formatting.

---

```jule
fn fprintf(mut f: &File, fmt: str, args: ...any)
```
Prints result of formatting to file. See documentation of format function for formatting.

---

```jule
fn sprint(args: ...any): str
```
Returns string result of arguments by default formatting.
4 changes: 4 additions & 0 deletions src/standard-library/std-fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ struct File
```
The file stream handle.

It works like a wrapper when it comes to console handle like stdin, stdout or stderr. Read and write functions are supported for console handlers. The rest of the functions are not supported and not checked, it is undefined behavior.

There may be system call differences and performance differences for console handlers depending on the operating system. For example, Windows has an overhead for UTF-16 processing.

**Methods:**

`static fn new(handle: uintptr): &File`\
Expand Down
21 changes: 21 additions & 0 deletions src/standard-library/std-io.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
# std::io
## Globals

```jule
static mut STDIN: &File
```
File handler for stdin.

---

```jule
static mut STDOUT: &File
```
File handler for stdout.

---

```jule
static mut STDERR: &File
```
File handler for stderr.

## Functions
```jule
fn readln(): str
Expand Down

0 comments on commit 3a2c914

Please sign in to comment.