You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/installation.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ The static binary does not work on a Mac, but you can compile Narya from source
78
78
Compiling from source
79
79
---------------------
80
80
81
-
If the static binary does not work for you (such as if you are on MacOS), or if you want to edit the Narya code, you will have to compile it yourself. This requires a recent version of OCaml and various libraries. Currently Narya is developed with OCaml 5.3.0; as far as I know, it also compiles with any version after 5.2.1, but this is not regularly verified. You can set up a :ref:`Manual development environment` or look into :ref:`Compiling with nix`.
81
+
If the static binary does not work for you (such as if you are on MacOS), or if you want to edit the Narya code, you will have to compile it yourself. This requires a recent version of OCaml and various libraries. Narya requires OCaml 5.3.0 or later. You can set up a :ref:`Manual development environment` or look into :ref:`Compiling with nix`.
Copy file name to clipboardExpand all lines: lib/top/execute.ml
+12-18Lines changed: 12 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -77,24 +77,18 @@ module Loaded = struct
77
77
letloaded_files : (FilePath.filename, data * float) Hashtbl.t =Hashtbl.create 20in
78
78
(* The complete merged namespace of all the files explicitly given on the command line so far. Imported into -e and -i. We compute it lazily because if there is no -e or -i we don't need it. (And also so that we won't try to read the flags before they're set.) It starts as the "current" namespace, which should be the top-level one. *)
79
79
letloaded_contents : Scope.trie Lazy.t ref =ref (Lazy.from_val (Scope.get_visible ())) in
80
-
leteffc : type b a. b Effect.t -> ((b, a) continuation -> a) option =function
81
-
|Add_to_files (file, data) ->
82
-
let mtime = (FileUtil.stat file).modification_time in
83
-
Some
84
-
(funk ->
85
-
Hashtbl.add loaded_files file (data, mtime);
86
-
continue k ())
87
-
|Get_filefile -> Some (funk -> continue k (Hashtbl.find_opt loaded_files file))
(* The effect handler that saves the continuation and returns the output passed to 'Yield'. *)
200
-
leteffc : type b. b Effect.t -> ((b, R.t) continuation -> R.t) option =function
201
-
|Yieldoutput ->
202
-
Some
203
-
(funk ->
204
-
cont :=Some k;
205
-
output)
206
-
|_ -> None
207
-
208
199
(* The coroutine. This calls itself with an infinite recursion and so never actually returns in an ordinary way, only by performing effects. But it is declared to have a return type of R.t, to match that of the effects. *)
209
200
letrec corun_top (f: unit -> R.t) : R.t =
210
201
(* The "Yield" effect returns control to the caller until we are continued. At that point execution resumes here with a new callback, which we then pass off to ourselves recursively. *)
0 commit comments