From 9fd493f30dfe0ce3f4d458090fc9a447ee6de2b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pant=C5=AF=C4=8Dek?= Date: Sat, 1 Apr 2023 19:44:11 +0200 Subject: [PATCH] Document all member-record-sub functions. --- MODULES.md | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/MODULES.md b/MODULES.md index 636fb12..f2b3684 100644 --- a/MODULES.md +++ b/MODULES.md @@ -98,7 +98,7 @@ Known types are: The structure is perfectly suited for ```print-source-listing``` function. - (member-sub-ref mr sec key [default]) + (member-record-sub-ref mr sec key [default]) * ```mr``` - a member record structure * ```sec``` - section symbol @@ -109,7 +109,7 @@ Retrieves given ```key``` from dictionary stored as section ```sec``` in given ```mr``` structure. If no ```default``` is provided and the ```key``` does not exist it raises an exception. - (member-sub-set mr sec key value) + (member-record-sub-set mr sec key value) * ```mr``` - a member record structure * ```sec``` - section symbol @@ -120,6 +120,36 @@ Sets the value of given ```key``` in dictionary stored as section ```sec``` in given ```mr``` structure to the new ```value``` possibly overwriting previous one. + (member-record-sub-prepend mr sec key value) + +* ```mr``` - a member record structure +* ```sec``` - section symbol +* ```key``` - key symbol +* ```value``` - value to prepend (cons) to the key current value + +Prepends (cons) new the ```value``` to current value of given ```key``` in +dictionary stored as section ```sec``` in given ```mr``` structure +replacing the original value. + + (member-record-sub-has-key? mr sec key) + +* ```mr``` - a member record structure +* ```sec``` - section symbol +* ```key``` - key symbol + +Returns ```#t``` if given section ```sec``` contains the ```key```. + + (member-record-sub-ensure mr sec key value) + +* ```mr``` - a member record structure +* ```sec``` - section symbol +* ```key``` - key symbol +* ```value``` - value to set + +Sets the value of given ```key``` in dictionary stored as section +```sec``` in given ```mr``` structure to the new ```value``` if and +only if it is not already present. + ### Member Parser ### Members Directory