John Bignucolo
2017-01-22 07:43:08 UTC
As part of learning Go, I've also been writing examples using the
equivalent features in Scheme. Scheme's hash-tables (as provided by
SRFI-125 in Larceny) serve a similar purpose to maps in Go.
I think Go wins with regard to succinctness. :-)
However, I did find the API defined in SRFI-125 to be good to use once I
also had a look at SRFI-128. The implementation I came up with wasn't that
different to the Go example.
So kudos to the authors.
I read some of the discussions for SRFI-125 as it evolved and noted the
concerns raised about its interaction with SRFI-128 (eg, "mustard" issues)
and the suggested use of definitions from SRFI-126.
I used the following import definition based on looking at the
implementation associated with the SRFI's:
(import (scheme base)
(scheme write)
(except (srfi 128)
hash-salt string-hash string-ci-hash symbol-hash)
(except (srfi 125)
string-hash string-ci-hash)
(srfi 126)
)
Is there a better way to get the appropriate definitions or is this a
reasonable approach?
Having to exclude some identifiers and import others is a bit messy in
comparison to other languages. I guess this will all be sorted out as part
of the Scheme "large language" discussions.
Regards,
John
equivalent features in Scheme. Scheme's hash-tables (as provided by
SRFI-125 in Larceny) serve a similar purpose to maps in Go.
I think Go wins with regard to succinctness. :-)
However, I did find the API defined in SRFI-125 to be good to use once I
also had a look at SRFI-128. The implementation I came up with wasn't that
different to the Go example.
So kudos to the authors.
I read some of the discussions for SRFI-125 as it evolved and noted the
concerns raised about its interaction with SRFI-128 (eg, "mustard" issues)
and the suggested use of definitions from SRFI-126.
I used the following import definition based on looking at the
implementation associated with the SRFI's:
(import (scheme base)
(scheme write)
(except (srfi 128)
hash-salt string-hash string-ci-hash symbol-hash)
(except (srfi 125)
string-hash string-ci-hash)
(srfi 126)
)
Is there a better way to get the appropriate definitions or is this a
reasonable approach?
Having to exclude some identifiers and import others is a bit messy in
comparison to other languages. I guess this will all be sorted out as part
of the Scheme "large language" discussions.
Regards,
John
--
John Bignucolo
***@gmail.com
John Bignucolo
***@gmail.com