Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Kleeneness is next to Godelness.


devel / comp.lang.lisp / Re: how to map a variable to a list?

SubjectAuthor
* Re: how to map a variable to a list?Jinsong Zhao
`* Re: how to map a variable to a list?Spiros Bousbouras
 `- Re: how to map a variable to a list?Spiros Bousbouras

1
Re: how to map a variable to a list?

<u18kne$btq7$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jsz...@yeah.net (Jinsong Zhao)
Newsgroups: comp.lang.lisp
Subject: Re: how to map a variable to a list?
Date: Thu, 13 Apr 2023 18:14:39 +0800
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <u18kne$btq7$1@dont-email.me>
References: <u111j3$26d7d$1@dont-email.me>
<024bfbe6-8505-431f-b027-e958e37de174n@googlegroups.com>
<u16a4t$31ink$1@dont-email.me>
<182a38b4-b108-4762-97f5-535db02cf348n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 13 Apr 2023 10:15:10 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="93be51509379c374760dfc6c18a971bd";
logging-data="390983"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Bd4J58JsiEEdwFKOFPGLd"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.9.1
Cancel-Lock: sha1:ZtcJNXPsSCMCrEgJGZUROooUOZ4=
Content-Language: en-US
In-Reply-To: <182a38b4-b108-4762-97f5-535db02cf348n@googlegroups.com>
 by: Jinsong Zhao - Thu, 13 Apr 2023 10:14 UTC

On 2023/4/13 9:06, Tom Russ wrote:
> On Wednesday, April 12, 2023 at 6:02:29 AM UTC-7, Jinsong Zhao wrote:
>> Thanks a lot for all your replies. DESTRUCTURING-BIND is what I want.
>
> Out of curiosity, what is an example of the code that you want to write?
>
> I ask because I wonder if a struct would be a better data structure than a list.
>
The list in my sample code is the size of the different sections decoded
from the binary header. Mapping them to locally named variables makes it
easy to check the validity of the file. Because it is only used once,
structure is perhaps too heavy. Also, there are rumors that structure is
obsolete and class should be used, which I am even less familiar with.

Thanks again for the reply and helps.

Best,
Jinsong

Re: how to map a variable to a list?

<nFiJYxTO0FX2FXr4a@bongo-ra.co>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: spi...@gmail.com (Spiros Bousbouras)
Newsgroups: comp.lang.lisp
Subject: Re: how to map a variable to a list?
Date: Thu, 13 Apr 2023 10:55:06 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <nFiJYxTO0FX2FXr4a@bongo-ra.co>
References: <u111j3$26d7d$1@dont-email.me> <024bfbe6-8505-431f-b027-e958e37de174n@googlegroups.com> <u16a4t$31ink$1@dont-email.me>
<182a38b4-b108-4762-97f5-535db02cf348n@googlegroups.com> <u18kne$btq7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 13 Apr 2023 10:55:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="8fc36f9bc329dc1d3f8ef5d8a1390c54";
logging-data="444663"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/6q8x8vZ7ZE1oX+A3ctDY+"
Cancel-Lock: sha1:YPdF1aZlyR4X0WW4wvxkPw8aJSs=
In-Reply-To: <u18kne$btq7$1@dont-email.me>
X-Server-Commands: nowebcancel
X-Organisation: Weyland-Yutani
 by: Spiros Bousbouras - Thu, 13 Apr 2023 10:55 UTC

On Thu, 13 Apr 2023 18:14:39 +0800
Jinsong Zhao <jszhao@yeah.net> wrote:
> The list in my sample code is the size of the different sections decoded
> from the binary header. Mapping them to locally named variables makes it
> easy to check the validity of the file. Because it is only used once,
> structure is perhaps too heavy.

Perhaps. Without knowing how the list gets created to begin with , it is
impossible to tell.

> Also, there are rumors that structure is
> obsolete and class should be used, which I am even less familiar with.

I don't know where you heard the "rumours" but they are wrong. Main
differences between classes and structures :

Classes Structures

Support multiple
inheritance YES NO

Can be redefined YES NO ; undefined
behaviour if you attempt
to do so.

So classes offer greater flexibility at the cost of execution speed
although I don't think it would cost too much in execution speed
if structures also offered multiple inheritance.

With structures you also get automatically defined accessors , print methods
and copier functions ; you can optionally define the layout to be a vector or
a list but then the structure does not become a new type in the CL type
system but counts as a vector or list respectively.

--
If it was a Bill Clinton day, the dry cleaners could have a special on removing
stains.
Mark O'Brien
http://www.stonekettle.com/2016/02/presidents-daze.html

Re: how to map a variable to a list?

<yQh74C70zllWtISq0@bongo-ra.co>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: spi...@gmail.com (Spiros Bousbouras)
Newsgroups: comp.lang.lisp
Subject: Re: how to map a variable to a list?
Date: Fri, 14 Apr 2023 02:34:19 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <yQh74C70zllWtISq0@bongo-ra.co>
References: <u111j3$26d7d$1@dont-email.me> <024bfbe6-8505-431f-b027-e958e37de174n@googlegroups.com> <u16a4t$31ink$1@dont-email.me>
<182a38b4-b108-4762-97f5-535db02cf348n@googlegroups.com> <u18kne$btq7$1@dont-email.me> <nFiJYxTO0FX2FXr4a@bongo-ra.co>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 14 Apr 2023 02:34:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="14131ab812d4b11cc708a4f96ec22832";
logging-data="1421915"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19eLFpF9ZaErSx6dN3vvVDJ"
Cancel-Lock: sha1:dfZRTsq8AzDXMht5V4bOFdVo8w8=
X-Organisation: Weyland-Yutani
In-Reply-To: <nFiJYxTO0FX2FXr4a@bongo-ra.co>
X-Server-Commands: nowebcancel
 by: Spiros Bousbouras - Fri, 14 Apr 2023 02:34 UTC

On Thu, 13 Apr 2023 10:55:06 -0000 (UTC)
Spiros Bousbouras <spibou@gmail.com> wrote:
> On Thu, 13 Apr 2023 18:14:39 +0800
> Jinsong Zhao <jszhao@yeah.net> wrote:
> > Also, there are rumors that structure is
> > obsolete and class should be used, which I am even less familiar with.
>
> I don't know where you heard the "rumours" but they are wrong. Main
> differences between classes and structures :
>
> Classes Structures
>
> Support multiple
> inheritance YES NO
>
>
> Can be redefined YES NO ; undefined
> behaviour if you attempt
> to do so.
>
>
> So classes offer greater flexibility at the cost of execution speed
> although I don't think it would cost too much in execution speed
> if structures also offered multiple inheritance.
>
> With structures you also get automatically defined accessors , print methods
> and copier functions ; you can optionally define the layout to be a vector or
> a list but then the structure does not become a new type in the CL type
> system but counts as a vector or list respectively.

Also the accessors in structures are regular functions whereas in classes they
are generic functions. So again , you get greater flexibility with classes at
the cost of execution speed. So structures and classes offer different
tradeoffs and neither one is going away , even without taking into account
backwards compatibility.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor