Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

There are new messages.


devel / comp.lang.lisp / Re: how to get Elements from a vector ?

SubjectAuthor
* how to get Elements from a vector ?Jens Kallup
`- Re: how to get Elements from a vector ?Raymond Wiker

1
how to get Elements from a vector ?

<ktm8n9Ftht9U3@mid.individual.net>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!news.samoylyk.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: kallup-dev@web.de (Jens Kallup)
Newsgroups: comp.lang.lisp
Subject: how to get Elements from a vector ?
Date: Sun, 10 Dec 2023 17:52:55 +0100
Lines: 33
Message-ID: <ktm8n9Ftht9U3@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net 4LEK+NkstAFwRCVbbfis7QWq0em2sHRMGwMNnbC6sGHKKnuthx
Cancel-Lock: sha1:Zxqf50vURBUPZwHrEpPed6KPYrM= sha256:r3ijVEURp5P0C9NgbwBqJPJaFFCrnCG1MZkCkQ2aZ1c=
User-Agent: Mozilla Thunderbird
 by: Jens Kallup - Sun, 10 Dec 2023 16:52 UTC

Hello,

I get TYPE-ERROR, when I try to get a element from the vector:

(sb-ext:disable-debugger)
(setf sb-ext:*muffled-warnings* 'style-warning)
(defvar *x* #(42 32))

(defun command-line-args ()
(or
#+clisp *args*
#+sbcl *posix-argv*
nil))

;;; -------------------------------------------------------------------
;;; @brief This is our main-entry point secured with some exception
;;; stuff.
;;; -------------------------------------------------------------------
(defun main ()
(handler-case
(progn
(write-line "Hallo Du")
(setf (aref *posix-argv* 0) *x*)
(write-line *x*)
(/ 3 2))
(division-by-zero (ex)
(progn
(format t "Exception error: DIVISION-BY-ZERO occured.")
(quit)))
(type-error (ex)
(progn
(format t "Exception error: type error.")
(quit)))))

Re: how to get Elements from a vector ?

<m2wmtm6ioc.fsf@MacBook-Pro-2.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rwiker@gmail.com (Raymond Wiker)
Newsgroups: comp.lang.lisp
Subject: Re: how to get Elements from a vector ?
Date: Sun, 10 Dec 2023 19:01:23 +0100
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <m2wmtm6ioc.fsf@MacBook-Pro-2.home>
References: <ktm8n9Ftht9U3@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="0d23082d8f72a9446670cdbc5d883bbf";
logging-data="2910892"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+B1VBb92w5cg8YOoZk7DKy"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:3nWlk+6Y3TJPFswnLf/1PZopaaI=
sha1:02fSG93gvqhn8smON3Mdes4+dbQ=
 by: Raymond Wiker - Sun, 10 Dec 2023 18:01 UTC

Jens Kallup <kallup-dev@web.de> writes:

> Hello,
>
> I get TYPE-ERROR, when I try to get a element from the vector:
>
> (sb-ext:disable-debugger)
> (setf sb-ext:*muffled-warnings* 'style-warning)
> (defvar *x* #(42 32))
>
> (defun command-line-args ()
> (or
> #+clisp *args*
> #+sbcl *posix-argv*
> nil))
>
> ;;; -------------------------------------------------------------------
> ;;; @brief This is our main-entry point secured with some exception
> ;;; stuff.
> ;;; -------------------------------------------------------------------
> (defun main ()
> (handler-case
> (progn
> (write-line "Hallo Du")
> (setf (aref *posix-argv* 0) *x*)
> (write-line *x*)
> (/ 3 2))
> (division-by-zero (ex)
> (progn
> (format t "Exception error: DIVISION-BY-ZERO occured.")
> (quit)))
> (type-error (ex)
> (progn
> (format t "Exception error: type error.")
> (quit)))))

A few things...

- *posix-argv* is a list, not an array (vector), so you cannot use aref
on it.

- write-line takes a a string parameter, and not an arbitrary object.

- it would be helpful if you show the actual error messages you get!

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor