aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cppawk-cons.16
-rw-r--r--cppawk-include/cons-priv.h34
-rw-r--r--cppawk-include/cons.h6
-rw-r--r--cppawk-include/iter.h7
4 files changed, 30 insertions, 23 deletions
diff --git a/cppawk-cons.1 b/cppawk-cons.1
index ec97a41..938774e 100644
--- a/cppawk-cons.1
+++ b/cppawk-cons.1
@@ -100,13 +100,13 @@ cons \- Lisp-like data representation and control flow macros
\fI// array -> list conversion\fP
- atol(\fIx\fP) \fI// convert values of Awk array a to list\fP
+ values(\fIx\fP) \fI// convert values of Awk array a to list\fP
keys(\fIx\fP) \fI// return list of keys of Awk array x\fP
\fI// field <-> list conversion\fP
- ftol(\fIx\fP) \fI// convert Awk positional fields to list\fP
- ltof(\fIx\fP) \fI// set Awk positional fields from list x\fP
+ fields(\fIx\fP) \fI// convert Awk positional fields to list\fP
+ set_fields(\fIx\fP) \fI// set Awk positional fields from list x\fP
\fI// list iteration\fP
diff --git a/cppawk-include/cons-priv.h b/cppawk-include/cons-priv.h
index 4482fa6..69c282a 100644
--- a/cppawk-include/cons-priv.h
+++ b/cppawk-include/cons-priv.h
@@ -313,8 +313,8 @@ function __reverse(__lst,
return __tmp;
}
-function __atol(__arr,
- __tmp, __key, __value)
+function __values(__arr,
+ __tmp, __key, __value)
{
__tmp = __list_begin()
@@ -324,7 +324,19 @@ function __atol(__arr,
return __list_end(__tmp)
}
-function __ftol( __tmp, __i, __val)
+function __keys(__array,
+ __key, __tmp)
+{
+ __tmp = __list_begin()
+
+ for (__key in __array)
+ __tmp = __list_add(__tmp, __key)
+
+ return __list_end(__tmp)
+}
+
+
+function __fields( __tmp, __i, __val)
{
__tmp = __list_begin()
@@ -334,8 +346,8 @@ function __ftol( __tmp, __i, __val)
return __list_end(__tmp)
}
-function __ltof(__lst, __start,
- __tmp, __item, __n)
+function __set_fields(__lst, __start,
+ __tmp, __item, __n)
{
if (!__present(__start))
__start = 1
@@ -348,18 +360,6 @@ function __ltof(__lst, __start,
return __n
}
-function __keys(__array,
- __key, __tmp)
-{
- __tmp = __list_begin()
-
- for (__key in __array)
- __tmp = __list_add(__tmp, __key)
-
- return __list_end(__tmp)
-}
-
-
function __equal(__obj1, __obj2)
{
if (__obj1 == __obj2)
diff --git a/cppawk-include/cons.h b/cppawk-include/cons.h
index b91877d..6b7774e 100644
--- a/cppawk-include/cons.h
+++ b/cppawk-include/cons.h
@@ -64,10 +64,10 @@
#define cdr __cdr
#define sexp __sexp
#define reverse __reverse
-#define atol __atol
-#define ftol __ftol
-#define ltof __ltof
+#define values __values
#define keys __keys
+#define fields __fields
+#define set_fields __set_fields
#define equal __equal
#define equalize __equalize
#define list __list
diff --git a/cppawk-include/iter.h b/cppawk-include/iter.h
index 8703fb1..3d154b1 100644
--- a/cppawk-include/iter.h
+++ b/cppawk-include/iter.h
@@ -169,6 +169,13 @@
#define __prep_fields(var) var = $ __g(var)
#define __fini_fields(var) 1
#define __step_fields(var) __g(var)++
+#define __temp___fields(var) __g(var),
+#define __init___fields(var) __g(var) = 1
+#define __test___fields(var) __g(var) <= NF
+#define __prep___fields(var) var = $ __g(var)
+#define __fini___fields(var) 1
+#define __step___fields(var) __g(var)++
+
#define __temp_keys(key, array) __g(key),
#define __init_keys(key, array) __g(key) = __keys(array)