[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] [PATCH] Fix types of condition manipulation procedures
From: |
Peter Bex |
Subject: |
[Chicken-hackers] [PATCH] Fix types of condition manipulation procedures [was: Re: [PATCH] Add more convenient condition object constructor [was: Re: [PATCH] Turn chicken.condition into a module, with syntax exports!]] |
Date: |
Sat, 27 May 2017 16:08:14 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Sat, May 27, 2017 at 03:34:54PM +1200, Evan Hanson wrote:
> Yeah, let's leave it at that. It's easy enough to convert property lists
> to something else as needed. I'm also not too worried about breaking
> changes here, so I've applied your patch as-is and updated the
> `condition->list` procedure to use the same plist representation.
I just noticed that you forgot to update its type in types.db.
The old type was
(chicken.condition#condition->list (#(procedure #:clean #:enforce)
chicken.condition#condition->list
((struct condition))
(list-of (pair symbol *))))
The (list-of (pair symbol *)) result type is wrong in two ways:
- the list structure has changed from "alist" to "plist", as we discussed
- exception "kind"s are not necessarily symbols
The new type therefore is:
(chicken.condition#condition->list (#(procedure #:clean #:enforce)
chicken.condition#condition->list
((struct condition))
(list-of pair)))
I chose (list-of pair) instead of just "list", because we know the
kind is always at the head of the "plist", so it's never null.
Given my observation that we incorrectly use "symbol" as the type
of kinds and properties, I went ahead and changed the other types
as well, by changing "symbol" to "*". The patch is also for master,
given that it's so simple and the situation applies there as well.
In master, the return type of condition->list is also simply
(list-of pair), because only the structure of the cdr of these
pairs differs between master and chicken-5 (and that can be null).
Cheers,
Peter
0001-Improve-type-declarations-for-condition-manipulation.chicken-5.patch
Description: Text Data
0001-Improve-type-declarations-for-condition-manipulation.master.patch
Description: Text Data
signature.asc
Description: Digital signature
- Re: [Chicken-hackers] [PATCH] Turn chicken.condition into a module, with syntax exports!, (continued)
- Re: [Chicken-hackers] [PATCH] Turn chicken.condition into a module, with syntax exports!, Peter Bex, 2017/05/07
- Re: [Chicken-hackers] [PATCH] Turn chicken.condition into a module, with syntax exports!, Evan Hanson, 2017/05/18
- Re: [Chicken-hackers] [PATCH] Turn chicken.condition into a module, with syntax exports!, Peter Bex, 2017/05/19
- [Chicken-hackers] [PATCH] Add more convenient condition object constructor [was: Re: [PATCH] Turn chicken.condition into a module, with syntax exports!], Peter Bex, 2017/05/20
- Re: [Chicken-hackers] [PATCH] Add more convenient condition object constructor [was: Re: [PATCH] Turn chicken.condition into a module, with syntax exports!], Evan Hanson, 2017/05/24
- Re: [Chicken-hackers] [PATCH] Add more convenient condition object constructor [was: Re: [PATCH] Turn chicken.condition into a module, with syntax exports!], Peter Bex, 2017/05/24
- Re: [Chicken-hackers] [PATCH] Add more convenient condition object constructor [was: Re: [PATCH] Turn chicken.condition into a module, with syntax exports!], Peter Bex, 2017/05/25
- Re: [Chicken-hackers] [PATCH] Add more convenient condition object constructor [was: Re: [PATCH] Turn chicken.condition into a module, with syntax exports!], Evan Hanson, 2017/05/26
- Re: [Chicken-hackers] [PATCH] Add more convenient condition object constructor [was: Re: [PATCH] Turn chicken.condition into a module, with syntax exports!], Peter Bex, 2017/05/27
- [Chicken-hackers] [PATCH] Fix types of condition manipulation procedures [was: Re: [PATCH] Add more convenient condition object constructor [was: Re: [PATCH] Turn chicken.condition into a module, with syntax exports!]],
Peter Bex <=
- Re: [Chicken-hackers] [PATCH] Fix types of condition manipulation procedures [was: Re: [PATCH] Add more convenient condition object constructor [was: Re: [PATCH] Turn chicken.condition into a module, with syntax exports!]], Evan Hanson, 2017/05/29