* list procedure
@ 2023-12-06 20:56 Damien Mattei
2023-12-06 21:37 ` Per Bothner
0 siblings, 1 reply; 3+ messages in thread
From: Damien Mattei @ 2023-12-06 20:56 UTC (permalink / raw)
To: kawa mailing list
[-- Attachment #1: Type: text/plain, Size: 551 bytes --]
hello,
at some point i needed to write something like that:
(list 'bracket-applynext
prefix
(cons list (parse-square-brackets-arguments (my-read-delimited-list
neoteric-read-real #\] port))))
and it resulted in sort of :
(bracket-applynext M_i_o (Type list j (+ i 1)))
which would surely result in error later...
why in Kawa this :
#|kawa:3|# list
Type list
instead of something <procedure list> ?
Damien
note : in my case i can (quote list) as it is for writing code evaluated
later and the ' will disappear in the display output i hope.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: list procedure
2023-12-06 20:56 list procedure Damien Mattei
@ 2023-12-06 21:37 ` Per Bothner
2023-12-06 23:26 ` Damien Mattei
0 siblings, 1 reply; 3+ messages in thread
From: Per Bothner @ 2023-12-06 21:37 UTC (permalink / raw)
To: Damien Mattei, kawa mailing list
On 12/6/23 12:56, Damien Mattei via Kawa wrote:
> why in Kawa this :
>
> #|kawa:3|# list
> Type list
>
> instead of something <procedure list> ?
Because in Kawa the identifier 'list' is bound to a Type.
This allows you to use ::list as a type-specifier.
If you apply a type as if it were procedure, you apply its constructor.
So it works out.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: list procedure
2023-12-06 21:37 ` Per Bothner
@ 2023-12-06 23:26 ` Damien Mattei
0 siblings, 0 replies; 3+ messages in thread
From: Damien Mattei @ 2023-12-06 23:26 UTC (permalink / raw)
To: Per Bothner; +Cc: kawa mailing list
[-- Attachment #1: Type: text/plain, Size: 800 bytes --]
ok i understand it is just a display, when it show "Type list" it is also
the procedure, anyway if my code had output #<procedure list> this should
have not worked as no scheme reader's understand that #<procedure list> is
the list procedure.
Damien
On Wed, Dec 6, 2023 at 10:37 PM Per Bothner <per@bothner.com> wrote:
>
>
> On 12/6/23 12:56, Damien Mattei via Kawa wrote:
> > why in Kawa this :
> >
> > #|kawa:3|# list
> > Type list
> >
> > instead of something <procedure list> ?
>
> Because in Kawa the identifier 'list' is bound to a Type.
> This allows you to use ::list as a type-specifier.
>
> If you apply a type as if it were procedure, you apply its constructor.
> So it works out.
> --
> --Per Bothner
> per@bothner.com http://per.bothner.com/
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-06 23:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-06 20:56 list procedure Damien Mattei
2023-12-06 21:37 ` Per Bothner
2023-12-06 23:26 ` Damien Mattei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).