Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Os stdlib module and separation of Eval/External module #139

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Foxinio
Copy link
Collaborator

@Foxinio Foxinio commented Jul 2, 2024

Looking at external function list made me think that there are too many
of them for one file, so i seperated them into modules making it easier
for extending functionality.

Implemented functionality that will allow for some system manipulation,
accessing environment variables, program arguments and system time.
Can be extended if there will be need for it.

Didn't write any tests since it's almost only linking of external functions from ocaml.

This PR is dependent on #126

lib/Os.fram Outdated

pub let fileExists = (extern dbl_fileExists : String ->[IO] Bool)

pub let isDirectory {`re : {X} -> Unit -> [|_]X } name =
Copy link
Collaborator

Choose a reason for hiding this comment

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

To be consistent with existing code:

Suggested change
pub let isDirectory {`re : {X} -> Unit -> [|_]X } name =
pub let isDirectory {`re : {X} -> Unit ->[|_] X } name =

lib/Os.fram Outdated
then (extern dbl_isDirectory : String ->[IO] Bool) name
else `re ()

pub let isRegularFile {`re : {X} -> Unit -> [|_]X } name =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here:

Suggested change
pub let isRegularFile {`re : {X} -> Unit -> [|_]X } name =
pub let isRegularFile {`re : {X} -> Unit ->[|_] X } name =

lib/Os.fram Outdated
pub let getUnixTime = (extern dbl_getUnixTime : Unit ->[IO] Int)

(* calculate date and time stamp from unix time *)
pub let getTime {`re : {X} -> Unit -> [|_]X } () =
Copy link
Collaborator

Choose a reason for hiding this comment

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

and here:

Suggested change
pub let getTime {`re : {X} -> Unit -> [|_]X } () =
pub let getTime {`re : {X} -> Unit ->[|_] X } () =

ppolesiuk and others added 2 commits January 14, 2025 14:24
Looking at external function list made me think that there are too many
of them for one file, so i seperated them into modules making it easier
for extending functionality.

Implemented functionality that will allow for some system manipulation,
accessing environment variables, program arguments and system time.
Can be extended if there will be need for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants