* What does #-3# mean?
@ 2010-08-23 16:03 Richard Shann
2010-08-24 16:38 ` Ludovic Courtès
0 siblings, 1 reply; 5+ messages in thread
From: Richard Shann @ 2010-08-23 16:03 UTC (permalink / raw)
To: guile-user
I am displaying a structure that seems to be circular, and it shows
(x_LIST . #-3#)
x_LIST is my own symbol but what is the meaning of the other member of the pair?
And how does one track it down this notation in the guile manual? I am
sure I came across this before, but cannot locate it in the manual
(again?)
Richard Shann
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What does #-3# mean?
2010-08-23 16:03 What does #-3# mean? Richard Shann
@ 2010-08-24 16:38 ` Ludovic Courtès
2010-08-24 20:46 ` dskr
0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2010-08-24 16:38 UTC (permalink / raw)
To: guile-user
Hi,
Richard Shann <richard.shann@virgin.net> writes:
> I am displaying a structure that seems to be circular, and it shows
>
> (x_LIST . #-3#)
>
> x_LIST is my own symbol but what is the meaning of the other member of the pair?
Indeed, it means it’s a circular list:
--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (use-modules (srfi srfi-1))
scheme@(guile-user)> (circular-list 1 2 3)
$1 = (1 2 3 . #-2#)
scheme@(guile-user)> (circular-list 1)
$2 = (1 . #0#)
--8<---------------cut here---------------end--------------->8---
> And how does one track it down this notation in the guile manual? I am
> sure I came across this before, but cannot locate it in the manual
> (again?)
It doesn’t seem to be documented but you get the idea. ;-)
Note that ‘read’ doesn’t understand it.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What does #-3# mean?
2010-08-24 16:38 ` Ludovic Courtès
@ 2010-08-24 20:46 ` dskr
2010-08-24 22:46 ` Andreas Rottmann
0 siblings, 1 reply; 5+ messages in thread
From: dskr @ 2010-08-24 20:46 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guile-user@gnu.org
I recall that the reader can be hash-extended to read these forms in a hacky way. Extend on '-'. I don't recall exactly anymore. I long ago patched the reader to read these natively. Perhaps there is some enthusiasm for making these readable in the main line?
Cheers,
Dan
On Aug 24, 2010, at 12:38 PM, ludo@gnu.org (Ludovic Courtès) wrote:
> Hi,
>
> Richard Shann <richard.shann@virgin.net> writes:
>
>> I am displaying a structure that seems to be circular, and it shows
>>
>> (x_LIST . #-3#)
>>
>> x_LIST is my own symbol but what is the meaning of the other member of the pair?
>
> Indeed, it means it’s a circular list:
>
> --8<---------------cut here---------------start------------->8---
> scheme@(guile-user)> (use-modules (srfi srfi-1))
> scheme@(guile-user)> (circular-list 1 2 3)
> $1 = (1 2 3 . #-2#)
> scheme@(guile-user)> (circular-list 1)
> $2 = (1 . #0#)
> --8<---------------cut here---------------end--------------->8---
>
>> And how does one track it down this notation in the guile manual? I am
>> sure I came across this before, but cannot locate it in the manual
>> (again?)
>
> It doesn’t seem to be documented but you get the idea. ;-)
>
> Note that ‘read’ doesn’t understand it.
>
> Thanks,
> Ludo’.
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What does #-3# mean?
2010-08-24 20:46 ` dskr
@ 2010-08-24 22:46 ` Andreas Rottmann
2010-08-25 9:52 ` Ludovic Courtès
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Rottmann @ 2010-08-24 22:46 UTC (permalink / raw)
To: dskr@mac.com; +Cc: Ludovic Courtès, guile-user@gnu.org
"dskr@mac.com" <dskr@mac.com> writes:
> I recall that the reader can be hash-extended to read these forms in a
> hacky way. Extend on '-'. I don't recall exactly anymore. I long ago
> patched the reader to read these natively. Perhaps there is some
> enthusiasm for making these readable in the main line?
>
I'd like to implement SRFI-38, and perhaps the best way would be to
modify the core reader/writer, instead of adding something like the
reference implementation? Would this require a new reader option, or
should it be always enabled?
Regards, Rotty
--
Andreas Rottmann -- <http://rotty.yi.org/>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What does #-3# mean?
2010-08-24 22:46 ` Andreas Rottmann
@ 2010-08-25 9:52 ` Ludovic Courtès
0 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2010-08-25 9:52 UTC (permalink / raw)
To: Andreas Rottmann; +Cc: guile-user@gnu.org
Hello,
Andreas Rottmann <a.rottmann@gmx.at> writes:
> "dskr@mac.com" <dskr@mac.com> writes:
>
>> I recall that the reader can be hash-extended to read these forms in a
>> hacky way. Extend on '-'. I don't recall exactly anymore. I long ago
>> patched the reader to read these natively. Perhaps there is some
>> enthusiasm for making these readable in the main line?
>>
> I'd like to implement SRFI-38, and perhaps the best way would be to
> modify the core reader/writer, instead of adding something like the
> reference implementation? Would this require a new reader option, or
> should it be always enabled?
I’d do it using either ‘read-hash-extend’, which should make it possible
to implement ‘read-with-shared-structure’ without touching ‘read’ (or
I’d take this opportunity to write a new ‘read’ in Scheme using SILex.
:-))
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-08-25 9:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-23 16:03 What does #-3# mean? Richard Shann
2010-08-24 16:38 ` Ludovic Courtès
2010-08-24 20:46 ` dskr
2010-08-24 22:46 ` Andreas Rottmann
2010-08-25 9:52 ` Ludovic Courtès
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).