pkgsrc/devel/omake/patches/patch-as

128 lines
3.8 KiB
Text
Raw Normal View History

Update to 0.9.8.6rc1 and add lots of upstream SVN patches to make it build again. Changes: This is a major feature enhancement and bugfix release * Added keyword and optional function arguments. The syntax of a keyword parameter/argument is "identifier = expr". Function Application ------------------------------------------- f(a) f(1) f(~a, b) f(~a = 10, 11) Required keyword argument f(?a, b) f(~a = 10, 12) Optional keyword argument f(12) -- defaults to empty f(?a = 1, b) f(~a = 10, 11) Optional keyword argument with default value f(~a = 1, b) f(11) -- ~a is same as ?a if there is a default value f(?a = 10, 11) -- Arguments can use ?, but it means the same thing Keyword arguments and normal arguments are processed independently. Normal arguments have to appear in the same order as in the parameter list, but keyword arguments can go anywhere. This also adds the function notation. fun(x, y) => add($x, $y) foreach(x => ..., a b c) println($x) where the "..." essentially means "parse as if the indented block below was actually an expression in here" Old-style foreach generate a warning. * Added "program" syntax. This provides a more standard programming language, where strings must be explicit, and variables represent applications. The outer syntax is normal; the program syntax is an ast to ast translation. The translation is turned on with the command ".LANGUAGE: program", which is scoped like "export". Here is an example: #!/usr/bin/env osh .LANGUAGE: program f(x) = return x + 1 println(f(f(1))) The normal $-style expressions are always allowed, but in program-syntax mode, identifiers stand for variables, function application is the f(e1, ..., e2) form, and there are the standard infix operators. To switch back to the default syntax, use .LANGUAGE: make Note, shell commands and rules never use program syntax, except within function arguments. This is not heavily tested. * Added support for partial and curried function applications. Normal funcation application still require using the correct number of arguments (as relaxed by the introduction of optional arguments), but apply function can be used to create curried and partial applications. f(x,y) = return $(add $x, $y) g = $(apply $f, 2) # Partial applications must use apply println($(g 3)) # 5 ff(x) = gg(y) = return $(add $x, $y) println($(apply $(ff), 3, 5)) # Prints 8, also need to use apply here apply can also take keyword arguments. * A high-quality C parser was added to OMake — see lib/parse/C/Parse.om * Added a LaTeX parser and spellchecker - see lib/parse/LaTeX/README.txt * New functions added: localtime, gmtime, mktime, normalize-tm, utimes, digest-string, url-escaped, find-all, addprefixes * New object added: Tm * About 10 Bugs fixed * [Experimental] Object methods can now export their fields back into the parent object. For example, Z. = x = 1 f() = x = 2 export Z.f() echo $(Z.x) # Prints "2" This works with arbitrary levels of nesting.
2010-12-17 10:40:14 +01:00
$NetBSD: patch-as,v 1.1 2010/12/17 09:40:14 wiz Exp $
From upstream SVN.
--- src/libmojave-external/unix/lm_notify.ml.orig 2007-07-19 21:06:05.000000000 +0000
+++ src/libmojave-external/unix/lm_notify.ml
@@ -153,10 +153,8 @@ let is_path_prefix (root1, path1) (root2
let is_monitored_name requests name =
let new_path = path_of_name name in
IntTable.exists (fun _ job ->
- let { job_path = path;
- job_recursive = recursive
- } = job
- in
+ let path = job.job_path in
+ let recursive = job.job_recursive in
new_path = path || (recursive && is_path_prefix path new_path)) requests
(************************************************************************
@@ -215,18 +213,16 @@ let close notify =
(*
* Get the file descriptor.
*)
-let file_descr { notify_fd = fd } =
- fd
+let file_descr notify =
+ notify.notify_fd
(*
* Monitoring.
*)
let monitor notify dir recursive =
- let { notify_info = info;
- notify_dirs = dirs;
- notify_requests = requests
- } = notify
- in
+ let info = notify.notify_info in
+ let dirs = notify.notify_dirs in
+ let requests = notify.notify_requests in
let name = name_of_dir dir in
if not (is_monitored_name requests name) then begin
if !debug_notify then
@@ -250,11 +246,9 @@ let monitor notify dir recursive =
* Suspend notifications.
*)
let suspend notify dir =
- let { notify_info = info;
- notify_dirs = dirs;
- notify_requests = requests
- } = notify
- in
+ let info = notify.notify_info in
+ let dirs = notify.notify_dirs in
+ let requests = notify.notify_requests in
let dir = name_of_dir dir in
let request =
try StringTable.find dirs dir with
@@ -269,10 +263,8 @@ let suspend notify dir =
end
let suspend_all notify =
- let { notify_info = info;
- notify_requests = requests
- } = notify
- in
+ let info = notify.notify_info in
+ let requests = notify.notify_requests in
IntTable.iter (fun _ job ->
if job.job_running then
begin
@@ -281,11 +273,9 @@ let suspend_all notify =
end) requests
let resume notify dir =
- let { notify_info = info;
- notify_dirs = dirs;
- notify_requests = requests
- } = notify
- in
+ let info = notify.notify_info in
+ let dirs = notify.notify_dirs in
+ let requests = notify.notify_requests in
let dir = name_of_dir dir in
let request =
try StringTable.find dirs dir with
@@ -300,10 +290,8 @@ let resume notify dir =
end
let resume_all notify =
- let { notify_info = info;
- notify_requests = requests
- } = notify
- in
+ let info = notify.notify_info in
+ let requests = notify.notify_requests in
IntTable.iter (fun _ job ->
if not job.job_running then
begin
@@ -315,11 +303,9 @@ let resume_all notify =
* Cancel a request.
*)
let cancel notify dir =
- let { notify_info = info;
- notify_dirs = dirs;
- notify_requests = requests
- } = notify
- in
+ let info = notify.notify_info in
+ let dirs = notify.notify_dirs in
+ let requests = notify.notify_requests in
let dir = name_of_dir dir in
let request =
try StringTable.find dirs dir with
@@ -332,10 +318,8 @@ let cancel notify dir =
notify.notify_requests <- IntTable.remove requests request
let cancel_all notify =
- let { notify_info = info;
- notify_requests = requests
- } = notify
- in
+ let info = notify.notify_info in
+ let requests = notify.notify_requests in
IntTable.iter (fun request _ -> notify_cancel info request) requests;
notify.notify_dirs <- StringTable.empty;
notify.notify_requests <- IntTable.empty