Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: Implementing lisp in Forth. Chapter 4. Date: Thu, 01 Sep 2016 19:49:12 -0700 Organization: A noiseless patient Spider Lines: 38 Message-ID: <87twdznhhz.fsf@jester.gateway.pace.com> References: <87bn0bplpm.fsf@jester.gateway.pace.com> <8737lkpr8n.fsf@jester.gateway.pace.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="7bfc8f5b1c0c0e2e29d3a5c3abe51644"; logging-data="5852"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NYp1qjW0eqLrEhb9/D+Qd" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:GqQl3TKM/8OgLDpfPkFMSHzX38U= sha1:2qHRhxtoaqubAHj9aAo6RM14ZqM= Xref: csiph.com comp.lang.forth:50603 albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) writes: >>a useful Lisp needs garbage collection. > Don't get me wrong, I understand that. But some allocate/free pairs > may be saved by using our usual stack approach Yes probably true, that's just an optimization though, and it's easiest to follow a straightforward approach first. If there's a GC you might as well use it, especially for stuff like the reader (Lisp terminology for the thing that parses S-expressions). Your Lisp isn't going to spend much of its time doing that. > Was gonna implement the parentheses as prefix/recognizer Would that also handle trailing parens (foo (bar (.... baz))) instead of treating "baz)))" as a Forth word? > There may be a fatal flaw. The lists of lvalues are not with links but > are allocated arrays. I'm not sure what you mean by that: traditionally you'd use cons nodes that each hold two values. > a LISP vacobulary with compiling words > ( prefix I wouldn't try to use the Forth text interpreter directly as a Lisp reader. You start wanting read macros written in Lisp, etc. Assuming the target machine is a PC or comparable, I wouldn't worry about the efficiency of the reader. I doubt you're planning to run megabytes of Lisp code. > This saturday Willem Ouwerker is going to present a two and a > sex legged robot at a combined meeting of the Robot and AI > user groups. I'll meet an AI Lisp expert there. Nice. It occurs to me given your interest in Euler problems, that your Lisp should also have bignums.