8.16.0.4
4 Converting Ini
(require ini/convert) | package: ini-lib |
procedure
(ini-section-params i section-name)
→ (or/c (listof param?) #false) i : ini? section-name : symbol?
Examples:
Examples:
> (define my-ini (ini (list (section 'configA (list (param 'paramA "valueA") (param 'paramB "valueB"))) (section 'configB (list (param 'paramA "valueA") (param 'paramB "valueB")))))) > (ini->hash my-ini)
'#hash((configA . #hash((paramA . "valueA") (paramB . "valueB")))
(configB . #hash((paramA . "valueA") (paramB . "valueB"))))
> (jsexpr->string (ini->hash my-ini)) "{\"configA\":{\"paramA\":\"valueA\",\"paramB\":\"valueB\"},\"configB\":{\"paramA\":\"valueA\",\"paramB\":\"valueB\"}}"
Examples:
> (define my-hash (hash 'configA (hash 'paramA "valueA" 'paramB "valueB") 'configB (hash 'paramA "valueA" 'paramB "valueB"))) > (hash->ini my-hash)
(ini
(list
(section 'configB (list (param 'paramB "valueB") (param 'paramA "valueA")))
(section 'configA (list (param 'paramB "valueB") (param 'paramA "valueA")))))
> (jsexpr->string my-hash) "{\"configA\":{\"paramA\":\"valueA\",\"paramB\":\"valueB\"},\"configB\":{\"paramA\":\"valueA\",\"paramB\":\"valueB\"}}"