Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Linux: The OS people choose without $200,000,000 of persuasion. -- Mike Coleman


devel / comp.lang.lisp / A library for building trees

SubjectAuthor
* A library for building treesSpiros Bousbouras
+- Re: A library for building treesPeri Didaskalou
`- Re: A library for building treesZyni Moë

1
A library for building trees

<zJqN=VXTFcRGCk1Ew@bongo-ra.co>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17163&group=comp.lang.lisp#17163

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!aioe.org!wMjcvFyyQbKkD1DyxkS8fQ.user.46.165.242.91.POSTED!not-for-mail
From: spibou@gmail.com (Spiros Bousbouras)
Newsgroups: comp.lang.lisp
Subject: A library for building trees
Date: Sun, 7 Aug 2022 13:27:39 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <zJqN=VXTFcRGCk1Ew@bongo-ra.co>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="62963"; posting-host="wMjcvFyyQbKkD1DyxkS8fQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-Organisation: Weyland-Yutani
X-Server-Commands: nowebcancel
 by: Spiros Bousbouras - Sun, 7 Aug 2022 13:27 UTC

I have written a Common Lisp library for building trees which I'm making
available under a "do anything you want license". It can be downloaded
at http://vlaho.ninja/prog/#trbu .For a more detailed explanation here
is an excerpt from
http://vlaho.ninja/prog/trbu/README.txt
{ When writing code for macros , the macro code generally constructs a list
which is the macro expansion. Sometimes you can do this using MAPCAR and
similar. But often I found myself in a situation where I constructed a
partial list and then , as I was parsing the code given in an invocation
of the macro , I gradually wanted to add more elements to the end of the
list. Using the standard APPEND for this gives quadratic performance. So
what I was doing was to PUSH elements to the front of the list and , when
I had created the whole expansion , I would do (reverse list) .With this
approach the code I was writing often looked unnatural to me. In
situations where one can construct the expansion list in one loop and it's
not convenient to use MAPCAR {or similar} , many people would use LOOP .I
don't like LOOP either so I needed a different solution hence I wrote this
library. The main idea is that you can append to the list you are
constructing in constant time rather than having to traverse the whole
list from the start. It's not just for macro expansions obviously but I
almost exlusively use it for that because , in every other situation where
I need a sequence , I'm much more likely to use a vector than a list.
}

http://vlaho.ninja/prog/trbu/manual.txt has plenty of examples.

--
Genius. It's a word. What does it really mean? If I win, I'm a genius.
If I don't, I'm not.
Bobby Fischer

Re: A library for building trees

<nIyIK.988053$X_i.875034@fx18.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17164&group=comp.lang.lisp#17164

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx18.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:105.0) Gecko/20100101
Thunderbird/105.0a1
Subject: Re: A library for building trees
Content-Language: en-US
Newsgroups: comp.lang.lisp
References: <zJqN=VXTFcRGCk1Ew@bongo-ra.co>
From: pfd@torfree.net (Peri Didaskalou)
In-Reply-To: <zJqN=VXTFcRGCk1Ew@bongo-ra.co>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 33
Message-ID: <nIyIK.988053$X_i.875034@fx18.iad>
X-Complaints-To: abuse@UsenetServer.com
NNTP-Posting-Date: Tue, 09 Aug 2022 19:37:55 UTC
Date: Tue, 9 Aug 2022 15:37:54 -0400
X-Received-Bytes: 2505
 by: Peri Didaskalou - Tue, 9 Aug 2022 19:37 UTC

On 2022-08-07 9:27 a.m., Spiros Bousbouras wrote:
> I have written a Common Lisp library for building trees which I'm making
> available under a "do anything you want license". It can be downloaded
> at http://vlaho.ninja/prog/#trbu .For a more detailed explanation here
> is an excerpt from
> http://vlaho.ninja/prog/trbu/README.txt
> {
> When writing code for macros , the macro code generally constructs a list
> which is the macro expansion. Sometimes you can do this using MAPCAR and
> similar. But often I found myself in a situation where I constructed a
> partial list and then , as I was parsing the code given in an invocation
> of the macro , I gradually wanted to add more elements to the end of the
> list. Using the standard APPEND for this gives quadratic performance. So
> what I was doing was to PUSH elements to the front of the list and , when
> I had created the whole expansion , I would do (reverse list) .With this
> approach the code I was writing often looked unnatural to me. In
> situations where one can construct the expansion list in one loop and it's
> not convenient to use MAPCAR {or similar} , many people would use LOOP .I
> don't like LOOP either so I needed a different solution hence I wrote this
> library. The main idea is that you can append to the list you are
> constructing in constant time rather than having to traverse the whole
> list from the start. It's not just for macro expansions obviously but I
> almost exclusively use it for that because , in every other situation where
> I need a sequence , I'm much more likely to use a vector than a list.
> }
>
> http://vlaho.ninja/prog/trbu/manual.txt has plenty of examples.
>

Brilliant Spiro!
It's always great to consider alternatives born out of need,
preference and/or frustration.

Re: A library for building trees

<tcvv91$1q4sn$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17165&group=comp.lang.lisp#17165

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: no_email@invalid.invalid (Zyni Moë)
Newsgroups: comp.lang.lisp
Subject: Re: A library for building trees
Date: Wed, 10 Aug 2022 09:54:41 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <tcvv91$1q4sn$1@dont-email.me>
References: <zJqN=VXTFcRGCk1Ew@bongo-ra.co>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 10 Aug 2022 09:54:41 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="6b39cfb60eec9da4e3f435f469b5df48";
logging-data="1905559"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19sfYt/axS/PJ+eZ52+9tiniPGINUy+51k="
User-Agent: NewsTap/5.5 (iPad)
Cancel-Lock: sha1:4H2t+i9vmKKll/qqHuaEz7ULLF8=
sha1:OZVEakOoGGecXJ1Tjm+MMmdSBqk=
 by: Zyni Moë - Wed, 10 Aug 2022 09:54 UTC

Spiros Bousbouras <spibou@gmail.com> wrote:
> I have written a Common Lisp library for building trees

Tim Bradshaw's 'collecting'
(https://tfeb.github.io/tfeb-lisp-hax/#collecting-lists-forwards-and-accumulating-collecting)
also does some of these things. Does not do the tree thing, but does allow
collecting into general objects.

--
the small snake

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor