help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lisp anime video


From: Arthur Miller
Subject: Re: Lisp anime video
Date: Mon, 06 Sep 2021 07:08:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Emanuel Berg via Users list for the GNU Emacs text editor 
<help-gnu-emacs@gnu.org> writes:

> Arthur Miller wrote:
>
>> Indeed lists can be fun. I think it is fun that there is no
>> explicit data structure called list in traditional lisps, it
>> just a way to work with conses.
>
> Hm ... interesting ...
>
> There is no explicit _list data type_ in Elisp,
>
>   (defvar  num-list nil)      ; nil
>   (setq    num-list '(1 2 3)) ; (1 2 3)
>   (listp   num-list)          ; t   
>   (type-of num-list)          ; cons
>
> But there is an explicit _list function_, i.e., `list', that
> returns a list, made up out of (car cdr) (or cons cells)
> but nonetheless ...
>
> Does that mean there is an explicit list data structure
> in Elisp? Or is it implicit?
Cons is an explicit data structure, so is vector, hash table etc.

Linked list is a bunch of nodes (conses) that form a list by data stored in
them. But yes it is a diffuse line. I guess only truly explicit data in a CPU is
a register.

> Or is it just implicit in '(1 2 3)?
>
>> By the way, I found a nice little program to show cons
>> structures (lists) and converted it to elisp. It is cool,
>> looks like box drawings in early papers.
>
> Can it do the other thing around?

It is left for you as an exercise to make it ;)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]