Skip to content
This repository was archived by the owner on Aug 10, 2020. It is now read-only.

Sys.argv, Sys.max_array_length, Sys.max_string_length are working #59

Open
wants to merge 1 commit into
base: source
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions docs/difference-from-native-ocaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ BuckleScript uses the same algorithm as native OCaml, but the output is differen

Not supported yet.

## Sys.argv, Sys.max_array_length, Sys.max_string_length

Command line arguments are always empty. This might be fixed in the future. `Sys.max_array_length` and `Sys.max_string_length` will be the same as `max_int`, but it might be respected.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I should only have removed Sys.argv?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the thing is such configuration does not sound very meaningful in js context

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, should this be merged?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure how to interpret "it might be respected". The max seems to be respected, currently. For example, trying to create a string with String.make(Sys.max_string_length + 1, 'c'); overflows and throws an exception Invalid_argument,-3,String.create. At least the part about Sys.argv could be removed.


## Unsupported IO Primitives

Because of the JS environment limitation, `Pervasives.stdin` is not supported but both `Pervasives.stdout` and `Pervasives.stderr` are.