chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

#1819: Add user-facing weak pairs API


From: Chicken Trac
Subject: #1819: Add user-facing weak pairs API
Date: Fri, 26 May 2023 07:14:27 -0000

#1819: Add user-facing weak pairs API
-------------------------------------+-------------------------------------
            Reporter:  sjamaan       |       Type:  defect
              Status:  new           |   Priority:  major
           Milestone:  someday       |  Component:  core libraries
             Version:  5.3.0         |   Keywords:  weak pairs, ephemerons,
Estimated difficulty:  medium        |  line numbers
-------------------------------------+-------------------------------------
 User "kluk" brought up on IRC that it would be nice to have line number
 information in the interpreter, for better error reporting.  This is
 somewhat problematic because the interpreter has to deal with potentially
 unbounded input, as one can reload files interactively or have code be
 `eval`ed at will.

 Perhaps a relatively simple solution would be to use a weak hash table for
 the line number database.

 Since we already *have* weak pairs in core, perhaps we should simply
 expose these to the user (and csi).

 We could use this API from MIT Scheme:

 https://web.mit.edu/scheme_v9.2/doc/mit-scheme-ref/Weak-Pairs.html

 Also in Chez Scheme:

 https://cisco.github.io/ChezScheme/csug9.5/smgmt.html#./smgmt:h2

 Then this could form the basis of a weak hash table API as well. Perhaps
 best left as an internal API (just like other compiler hash tables are
 also internal). Later someone(TM) can provide an egg with a proper weak
 hash table API.

 We should probably also look seriously into ephemerons (a la
 https://srfi.schemers.org/srfi-124/srfi-124.html), but from
 https://scheme-48.s48.narkive.com/YJq3GJOw/ephemerons-long-message-with-a
 -brief-preamble it seems these are somewhat trickier to implement, so that
 might be for a later version.

-- 
Ticket URL: <https://bugs.call-cc.org/ticket/1819>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]