Skip to content
This repository was archived by the owner on Jun 19, 2022. It is now read-only.

Latest commit

 

History

History
29 lines (19 loc) · 739 Bytes

WRITEFD.md

File metadata and controls

29 lines (19 loc) · 739 Bytes

Writefd instruction

writefd in the rys programming language is an instruction which can write textual data to a specified file descriptor number

writefd instruction takes two arguments:

  • Data: text to write to that file descriptor
  • FD: File descriptor number (for example 2 for STDERROR)

And it returns the string length

Example of writefd:

"Hello world" 1 writefd   -- Write "Hello world" to STDOUT
1 drop                    -- Drops bytes written

data can also be a number:

1337 1 writefd   -- Write "1337" to STDOUT
1 drop           -- Drops bytes written

It will get converted to a string...

Example of how writefd can be used in the hello world example