* Scheme syntax tree
@ 2015-12-04 20:08 Jan Synáček
2015-12-04 21:00 ` David Kastrup
2015-12-04 21:07 ` Thompson, David
0 siblings, 2 replies; 3+ messages in thread
From: Jan Synáček @ 2015-12-04 20:08 UTC (permalink / raw)
To: Guile User
Hello,
I have a feeling that I saw a module that can parse a scheme program
into a syntax tree somewhere. Does such module exist? Or do I have to
roll my own?
Cheers,
--
Jan Synáček
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Scheme syntax tree
2015-12-04 20:08 Scheme syntax tree Jan Synáček
@ 2015-12-04 21:00 ` David Kastrup
2015-12-04 21:07 ` Thompson, David
1 sibling, 0 replies; 3+ messages in thread
From: David Kastrup @ 2015-12-04 21:00 UTC (permalink / raw)
To: guile-user
Jan Synáček <jan.synacek@gmail.com> writes:
> Hello,
>
> I have a feeling that I saw a module that can parse a scheme program
> into a syntax tree somewhere. Does such module exist? Or do I have to
> roll my own?
Uh, it's called the reader. It's sort of the point of Lisp-like
languages that you write down the parse tree and save the computer the
work.
GUILE has tree-il and other representation which are _later_ stages in
the compilation than the "syntax tree" is: see
<URL:https://www.gnu.org/software/guile/manual/html_node/Compiler-Tower.html>.
--
David Kastrup
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Scheme syntax tree
2015-12-04 20:08 Scheme syntax tree Jan Synáček
2015-12-04 21:00 ` David Kastrup
@ 2015-12-04 21:07 ` Thompson, David
1 sibling, 0 replies; 3+ messages in thread
From: Thompson, David @ 2015-12-04 21:07 UTC (permalink / raw)
To: Jan Synáček; +Cc: Guile User
On Fri, Dec 4, 2015 at 3:08 PM, Jan Synáček <jan.synacek@gmail.com> wrote:
>
> I have a feeling that I saw a module that can parse a scheme program
> into a syntax tree somewhere. Does such module exist? Or do I have to
> roll my own?
Scheme is its own syntax tree, this is why they call Scheme (and other
Lisps) "homoiconic." If you want to read a s-expression from an open
port, just use 'read'.
Happy hacking,
- Dave
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-12-04 21:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-04 20:08 Scheme syntax tree Jan Synáček
2015-12-04 21:00 ` David Kastrup
2015-12-04 21:07 ` Thompson, David
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).