Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Just think of a computer as hardware you can program." -- Nigel de la Tierre


devel / comp.lang.lisp / typep confusion

SubjectAuthor
* typep confusionDavid Richards
`* Re: typep confusionAlan Bawden
 `* Re: typep confusionDavid Richards
  `* Re: typep confusionTom Russ
   `- Re: typep confusionMadhu

1
typep confusion

<2769ef27-cdf2-4ac3-ade6-478a44568738n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
X-Received: by 2002:a05:600c:2055:b0:3a0:4605:df1a with SMTP id p21-20020a05600c205500b003a04605df1amr5832932wmg.75.1656509761153;
Wed, 29 Jun 2022 06:36:01 -0700 (PDT)
X-Received: by 2002:a05:6808:1708:b0:335:1b16:fb09 with SMTP id
bc8-20020a056808170800b003351b16fb09mr3193291oib.7.1656509760052; Wed, 29 Jun
2022 06:36:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!pasdenom.info!nntpfeed.proxad.net!feeder1-1.proxad.net!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.lisp
Date: Wed, 29 Jun 2022 06:35:59 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=72.229.162.33; posting-account=_oERGAoAAACGuUjLc5ikUyaX4lvBZGWz
NNTP-Posting-Host: 72.229.162.33
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2769ef27-cdf2-4ac3-ade6-478a44568738n@googlegroups.com>
Subject: typep confusion
From: dnewtonrichards@gmail.com (David Richards)
Injection-Date: Wed, 29 Jun 2022 13:36:01 +0000
Content-Type: text/plain; charset="UTF-8"
 by: David Richards - Wed, 29 Jun 2022 13:35 UTC

Hello all,
I am expecting the following to return false (NIL). What am I not understanding? I get the same result in SBCL, CLISP and Allegro-lisp so clearly it's me!
(typep #("Hello" "world") '(vector number))
T

Thanks!
Dave

Re: typep confusion

<86edz7tvto.fsf@williamsburg.bawden.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: alan@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.lisp
Subject: Re: typep confusion
Date: Wed, 29 Jun 2022 09:58:59 -0400
Organization: ITS Preservation Society
Lines: 15
Message-ID: <86edz7tvto.fsf@williamsburg.bawden.org>
References: <2769ef27-cdf2-4ac3-ade6-478a44568738n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="a1d448fd6fef6a8b941dd49c17779185";
logging-data="1529809"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+dq2O6vsea8+bNUpK/bUxh"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:tEM8R0Ehz95GLC9UKoionchS+qY=
sha1:MJ39Ma3nAOkDxCRiupF9w1Se/pg=
 by: Alan Bawden - Wed, 29 Jun 2022 13:58 UTC

David Richards <dnewtonrichards@gmail.com> writes:

Hello all,
I am expecting the following to return false (NIL). What am I not
understanding? I get the same result in SBCL, CLISP and Allegro-lisp so
clearly it's me!
(typep #("Hello" "world") '(vector number))
T

Because (UPGRADED-ARRAY-ELEMENT-TYPE 'NUMBER) is T, and so (VECTOR NUMBER)
is really just the same as (VECTOR T). If any of those implementations
supported an array type that could _only_ contain numbers (and _not_
strings), then you would get a different answer in that implementation.

- Alan

Re: typep confusion

<ce083913-9798-49a2-875a-78b805aa2ac5n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
X-Received: by 2002:a5d:4308:0:b0:219:e5a4:5729 with SMTP id h8-20020a5d4308000000b00219e5a45729mr3752030wrq.210.1656514884306;
Wed, 29 Jun 2022 08:01:24 -0700 (PDT)
X-Received: by 2002:a05:6870:d10c:b0:102:820:1231 with SMTP id
e12-20020a056870d10c00b0010208201231mr2259671oac.122.1656514883392; Wed, 29
Jun 2022 08:01:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.lisp
Date: Wed, 29 Jun 2022 08:01:23 -0700 (PDT)
In-Reply-To: <86edz7tvto.fsf@williamsburg.bawden.org>
Injection-Info: google-groups.googlegroups.com; posting-host=72.229.162.33; posting-account=_oERGAoAAACGuUjLc5ikUyaX4lvBZGWz
NNTP-Posting-Host: 72.229.162.33
References: <2769ef27-cdf2-4ac3-ade6-478a44568738n@googlegroups.com> <86edz7tvto.fsf@williamsburg.bawden.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ce083913-9798-49a2-875a-78b805aa2ac5n@googlegroups.com>
Subject: Re: typep confusion
From: dnewtonrichards@gmail.com (David Richards)
Injection-Date: Wed, 29 Jun 2022 15:01:24 +0000
Content-Type: text/plain; charset="UTF-8"
 by: David Richards - Wed, 29 Jun 2022 15:01 UTC

On Wednesday, June 29, 2022 at 9:59:34 AM UTC-4, Alan Bawden wrote:
> David Richards <dnewton...@gmail.com> writes:
>
> Hello all,
> I am expecting the following to return false (NIL). What am I not
> understanding? I get the same result in SBCL, CLISP and Allegro-lisp so
> clearly it's me!
> (typep #("Hello" "world") '(vector number))
> T
> Because (UPGRADED-ARRAY-ELEMENT-TYPE 'NUMBER) is T, and so (VECTOR NUMBER)
> is really just the same as (VECTOR T). If any of those implementations
> supported an array type that could _only_ contain numbers (and _not_
> strings), then you would get a different answer in that implementation.
>
> - Alan
Thank you Alan for the answer! So if I wanted to make certain that an array holds only strings I'd have to use something like
(every 'stringp #("Hello" "World"))
right?
Thanks!
Dave

Re: typep confusion

<50ba9190-a8a2-4036-94c6-b802174e9e60n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
X-Received: by 2002:adf:fad2:0:b0:21b:b947:bfa8 with SMTP id a18-20020adffad2000000b0021bb947bfa8mr5559133wrs.73.1656543311147;
Wed, 29 Jun 2022 15:55:11 -0700 (PDT)
X-Received: by 2002:a05:6808:2385:b0:32f:5b48:af5a with SMTP id
bp5-20020a056808238500b0032f5b48af5amr3661764oib.58.1656543309986; Wed, 29
Jun 2022 15:55:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.128.87.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.lisp
Date: Wed, 29 Jun 2022 15:55:09 -0700 (PDT)
In-Reply-To: <ce083913-9798-49a2-875a-78b805aa2ac5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2620:0:102f:1005:6ca0:2a28:384:940b;
posting-account=05zmAwoAAAAJZM-3jv1hCWLHGZQceqwA
NNTP-Posting-Host: 2620:0:102f:1005:6ca0:2a28:384:940b
References: <2769ef27-cdf2-4ac3-ade6-478a44568738n@googlegroups.com>
<86edz7tvto.fsf@williamsburg.bawden.org> <ce083913-9798-49a2-875a-78b805aa2ac5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <50ba9190-a8a2-4036-94c6-b802174e9e60n@googlegroups.com>
Subject: Re: typep confusion
From: taruss@google.com (Tom Russ)
Injection-Date: Wed, 29 Jun 2022 22:55:11 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Tom Russ - Wed, 29 Jun 2022 22:55 UTC

On Wednesday, June 29, 2022 at 8:02:18 AM UTC-7, dnewton...@gmail.com wrote:
> On Wednesday, June 29, 2022 at 9:59:34 AM UTC-4, Alan Bawden wrote:
> > David Richards <dnewton...@gmail.com> writes:
> >
> > Hello all,
> > I am expecting the following to return false (NIL). What am I not
> > understanding? I get the same result in SBCL, CLISP and Allegro-lisp so
> > clearly it's me!
> > (typep #("Hello" "world") '(vector number))
> > T
> > Because (UPGRADED-ARRAY-ELEMENT-TYPE 'NUMBER) is T, and so (VECTOR NUMBER)
> > is really just the same as (VECTOR T). If any of those implementations
> > supported an array type that could _only_ contain numbers (and _not_
> > strings), then you would get a different answer in that implementation.
> >
> > - Alan
> Thank you Alan for the answer! So if I wanted to make certain that an array holds only strings I'd have to use something like
> (every 'stringp #("Hello" "World"))
> right?
> Thanks!
> Dave

Yes.

Re: typep confusion

<m3y1xf9bgn.fsf@leonis4.robolove.meer.net>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: enometh@meer.net (Madhu)
Newsgroups: comp.lang.lisp
Subject: Re: typep confusion
Date: Thu, 30 Jun 2022 07:09:04 +0530
Organization: Motzarella
Lines: 31
Message-ID: <m3y1xf9bgn.fsf@leonis4.robolove.meer.net>
References: <2769ef27-cdf2-4ac3-ade6-478a44568738n@googlegroups.com>
<86edz7tvto.fsf@williamsburg.bawden.org>
<ce083913-9798-49a2-875a-78b805aa2ac5n@googlegroups.com>
<50ba9190-a8a2-4036-94c6-b802174e9e60n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="9813627105f055e1dbcd482e5bbe1432";
logging-data="7536"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18m6moki9Vilw5bdhndMdBSK7hUMporj3Q="
Cancel-Lock: sha1:qqVmhz/WXAacx/aBRHg/VPfjhRg=
sha1:Vn3HvZn6NI8q+c41qXbjhPopv1E=
 by: Madhu - Thu, 30 Jun 2022 01:39 UTC

* Tom Russ <50ba9190-a8a2-4036-94c6-b802174e9e60n @googlegroups.com> :
Wrote on Wed, 29 Jun 2022 15:55:09 -0700 (PDT):
> On Wednesday, June 29, 2022 at 8:02:18 AM UTC-7, ??? wrote:
>> On Wednesday, June 29, 2022 at 9:59:34 AM UTC-4, Alan Bawden wrote:
>> > David Richards ??? writes:
>> > I am expecting the following to return false (NIL). What am I not
>> > understanding? I get the same result in SBCL, CLISP and Allegro-lisp so
>> > clearly it's me!
>> > (typep #("Hello" "world") '(vector number))
>> > T
>> > Because (UPGRADED-ARRAY-ELEMENT-TYPE 'NUMBER) is T, and so (VECTOR NUMBER)
>> > is really just the same as (VECTOR T). If any of those implementations
>> > supported an array type that could _only_ contain numbers (and _not_
>> > strings), then you would get a different answer in that implementation.
>> Thank you Alan for the answer! So if I wanted to make certain that
>> an array holds only strings I'd have to use something like
>> (every 'stringp #("Hello" "World"))
>> right?
>> Thanks!
>Yes.

You can even turn that predicate expression into a type with SATISFIES,
but you need to make it a named function first

(defun all-strings-p (seq)
(every 'stringp seq))

(deftype string-vec ()
`(and vector (satisfies all-strings-p)))

(typep #("Hello World") 'string-vec) ;;=> T

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor