On this page:
read
Read  Mode
Read  Mode.top
Read  Mode.interactive
Read  Mode.line
Read  Mode.text
8.15.0.12

13.7 Shrubbery Input🔗ℹ

 import: rhombus/shrubbery package: rhombus-lib

function

fun shrubbery.read(in :: Port.Input,

                   ~mode: mode :: shrubbery.ReadMode = #'top,

                   ~start_column: start_column :: Int = 0)

  :: Syntax || Port.eof

 

enumeration

enum shrubbery.ReadMode:

  top

  interactive

  line

  text

Reads a shrubbery form from in. The result can be Port.eof only in #'interactive or #'line modes.

import rhombus/shrubbery

> shrubbery.read(Port.Input.open_string("fun (x):\n  x + 1"))

'fun (x): x + 1'