[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-janitors] #1445: Support parameterised hash table type decl
From: |
Chicken Trac |
Subject: |
Re: [Chicken-janitors] #1445: Support parameterised hash table type declarations |
Date: |
Mon, 19 Feb 2018 06:18:12 -0000 |
#1445: Support parameterised hash table type declarations
-------------------------------------+-------------------------------------
Reporter: evhan | Owner:
Type: enhancement | Status: new
Priority: not urgent | Milestone: someday
at all |
Component: scrutinizer | Version: 5.0
Resolution: | Keywords: scrutiniser, srfi-69
Estimated difficulty: medium |
-------------------------------------+-------------------------------------
Comment (by megane):
Btw, I was not targeting specifically hash-tables, but general user
defined types.
Here's an alternative patch.
This codes the parameters into a list in the third element,
(struct name (param ...)).
Some features of the matcher:
- (struct foo #f) == (struct foo)
- (struct foo (* ...)) is simplified into (struct foo)
- (struct foo #f) matches with (struct foo any-list)
- If A and B are lists, then
(struct foo A) and (struct foo B) only match if
(= (length A) (length B)) and all the elements of A and B match.
For example, giving (struct foo (a)) where (struct foo (* b)) is
expected causes a type warning.
--
Ticket URL: <https://bugs.call-cc.org/ticket/1445#comment:2>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.