From: Chaos Eternal <chaoseternal@shlug.org>
To: guile-user <guile-user@gnu.org>
Subject: Re: pretty-print for 1+
Date: Wed, 18 Sep 2013 11:27:35 +0800 [thread overview]
Message-ID: <CAGyY8Ntrmk8N8HxsS9o-9jfyNj54LkcSNXafNL=sMXCww3uObQ@mail.gmail.com> (raw)
In-Reply-To: <87fvt3hil4.fsf@gnu.org>
yet there is another interesting thing:
(symbol? 'a) => #t
(symbol? '+a) => #t
(symbol? '-a) => #t
(symbol? 'b) => #t
(symbol? '+b) => #t
(symbol? '-b) => #t
BUT:
(symbol? 'i) => #t
(symbol? '+i) => #f
(symbol? '-i) => #f
In guile-scsh, user would like the guile recognize -i as symbols
rather than complex numbers, is there any way?
On Tue, Sep 17, 2013 at 6:02 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> Brian Killian <brian.c.killian@gmail.com> skribis:
>
>> On Thu, Sep 12, 2013 at 6:04 PM, Ludovic Courtès <ludo@gnu.org> wrote:
>>
>>> Brian Killian <brian.c.killian@gmail.com> skribis:
>>>
>>> > Using guile 2.0.9 and the ice-9 pretty-print module, when I apply:
>>> >
>>> > (pretty-print '(1+ 1))
>>> >
>>> > I get:
>>> >
>>> > (#{1+}# 1)
>>> >
>>> > I was expecting:
>>> >
>>> > (1+ 1)
>>> >
>>> > Is this an issue with pretty-print or should I adjust my expectation?
>>>
>>> I think it’s an issue with ‘write’. Specifically,
>>> ‘INITIAL_IDENTIFIER_MASK’ in print.c doesn’t quite match the syntax
>>> recognized by ‘read’.
>>>
>>> Ludo’.
>>>
>>>
>>>
>> Thank you for the information. I'm using (+ arg 1) instead of (1+ arg) as a
>> workaround.
>
> Well note that (#{1+}# 1) is valid and equivalent to (1+ 1).
>
>> I'm using pretty-print to format code snippets as I work through SICP,
>> which is becoming tedious. Do you know of a script or tool that formats
>> Scheme files using the pretty-print rules? I've switched from gedit to
>> Emacs as an editor, but Emacs only seems to indent things properly, rather
>> than stripping extraneous newlines and trying to fit expressions on one
>> line if possible like pretty-print does.
>
> Good question, I don’t know of any such tool.
>
> Ludo’.
>
>
next prev parent reply other threads:[~2013-09-18 3:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-11 18:31 pretty-print for 1+ Brian Killian
2013-09-12 22:04 ` Ludovic Courtès
2013-09-14 20:06 ` Brian Killian
2013-09-17 10:02 ` Ludovic Courtès
2013-09-18 3:27 ` Chaos Eternal [this message]
2013-09-18 18:57 ` Taylan Ulrich B.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGyY8Ntrmk8N8HxsS9o-9jfyNj54LkcSNXafNL=sMXCww3uObQ@mail.gmail.com' \
--to=chaoseternal@shlug.org \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).