From 5413d5e7eaa6ef55608f0a3309f83b368c8d88b9 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 16 Apr 2022 10:00:37 -0700 Subject: Rename some array and field conversion functions. atol -> values ftol -> fields ltof -> set_fields values() goes with existing keys() nicely. --- cppawk-include/cons-priv.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'cppawk-include/cons-priv.h') 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) -- cgit v1.2.3