cache.ha (496B)
1 // SPDX-License-Identifier: MPL-2.0 2 // (c) Hare authors <https://harelang.org> 3 4 use path; 5 6 // Gets the cache directory for a given module, given the value of 'harecache'. 7 // The result is statically allocated and will be overwritten on subsequent 8 // calls. An error is returned if the resulting path would be longer than 9 // [[path::MAX]]. 10 export fn get_cache(harecache: str, modpath: str) (str | error) = { 11 static let buf = path::buffer { ... }; 12 return path::set(&buf, harecache, modpath)?; 13 };