Skip to content

Commit

Permalink
Added readLine function to the IO module
Browse files Browse the repository at this point in the history
  • Loading branch information
stackoverflow committed Jun 18, 2022
1 parent 46ff4d9 commit d59ebd5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 6 additions & 5 deletions releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@

## Changes

- Added factorial function to Math module
- Added toStringList function to String module
- Added Contained instance to Map
- Added Show instance to primitive arrays
- Added <primitiveArray>FromList functions to Array module
- Added `factorial` function to `Math` module
- Added `toStringList` function to `String` module
- Added `Contained` instance to `Map`
- Added `Show` instance to primitive arrays
- Added `<primitiveArray>FromList` functions to `Array` module
- Added `readLine` function to the `IO` module
- Added range support for `BigInteger` and `BigDecimal`
- Made `^` operator generic and added implementation for `Float64`, `BigInteger` and `BigDecimal`

Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/novah/io.novah
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import novah.list as List

foreign import java.io.File
foreign import java.lang.CharSequence
foreign import java.lang.System
foreign import java.nio.charset.Charset
foreign import java.nio.charset.StandardCharsets
foreign import java.nio.file.Files
Expand Down Expand Up @@ -104,4 +105,9 @@ writeText file text =
pub
appendText : File -> String -> Path
appendText file text =
writeTextToPath file#toPath() text utf8 [Append, Create]
writeTextToPath file#toPath() text utf8 [Append, Create]

// Reads a line from standard input.
pub
readLine : Unit -> String
readLine _ = System#console()#readLine()

0 comments on commit d59ebd5

Please sign in to comment.