Re: [GSOC][PATCH] userdiff: add support for Scheme
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Mar 29, 2021, 10:08 UTC
- Message-ID
- <62695830-2f9e-c3b5-856c-01b97eb2c3af@gmail.com>
- In-Reply-To
- <578FC14B-CB72-41CA-A8FD-1480EBCCB968@gmail.com>
Hi Atharva
On 28/03/2021 13:40, Atharva Raykar wrote:
Show 25 quoted lines
> On 28-Mar-2021, at 08:46, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote: >> The "define-?.*" can be simplified to just "define.*", but looking at >> the tests is that the intent? From the tests it looks like "define[- ]" >> is what the author wants, unless this is meant to also match >> "(definements". > > Yes, you captured my intent correctly. Will fix it. > >> Has this been tested on some real-world scheme code? E.g. I have guile >> installed locally, and it has really large top-level eval-when >> blocks. These rules would jump over those to whatever the function above >> them is. > > I do not have a large scheme codebase on my own, I usually use Racket, > which is a much larger language with many more forms. Other Schemes like > Guile also extend the language a lot, like in your example, eval-when is > an extension provided by Guile (and Chicken and Chez), but not a part of > the R6RS document when I searched its index. > > So the 'define' forms are the only one that I know would reliably be present > across all schemes. But one can also make a case where some of these non-standard > forms may be common enough that they are worth adding in. In that case which > forms to include? Should we consider everything in the SRFI's[1]? Should the > various module definitions of Racket be included? It's a little tricky to know > where to stop.
If there are some common forms such as eval-when then it would be good to include them, otherwise we end up needing a different rule for each scheme implementation as they all seem to tweak something. Gerbil uses 'def...' e.g def, defsyntax, defstruct, defrules rather than define, define-syntax, define-record etc. I'm not user if we want to accommodate that or not.
Best Wishes
Phillip
Show 6 quoted lines
> That being said, I will try to run this through more Scheme codebases that I can > find and see if there are any forms that seem to show up commonly enough that they > are worth including. > > [1] https://en.wikipedia.org/wiki/Scheme_Requests_for_Implementation >