Is there any way by which conscan be implemented in Common LISP using the list, append, first, restand etc.
cons
list
append
first
rest
In the following code
(defun my_list (&rest arguments) `(,@arguments) ; Line 1 )
What does full line 1 mean?
First question: No, because it consis the building block for listand append, and not vice versa. It is like trying to build a brick from a house.
Second question: the backquote syntax is explained in the CLHS ( http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_2-4-6.html ).
Stylistic comments:
It is spelled "Common Lisp".
, : my-list.
my-list
. :
(defun my-list (&rest arguments) `(,@arguments)) ; Line 1
backquote . :
(defun my-list (&rest arguments) arguments)
, cons list append, :
(defun cons (car cdr) (append (list car) cdr))
::,if my_symbol = 1`(my_symbol 2 3) = (my_symbol 2 3), ::
`(my_symbol 2 3) = (my_symbol 2 3)
`(,my_symbol 2 3) = (1 2 3)
The, `statement
@( , )
`(,@('a 'b 'c) ('d 'e 'f)) = ('a 'b 'c ('d 'e 'f) )
`(,@('a 'b 'c) ,@('d 'e 'f) ) = ('a 'b 'c 'd 'e 'f)
, . , 1 .
?
(defun cons (a b) '(a . b))
, ...
(defun cons (a b) (first (list '(a . b))))
Source: https://habr.com/ru/post/1775654/More articles:How to increase the value of $ var without a loop in PHP? - phpEmacs -fs (fullscreen) - emacswho are the people devs / techies should follow on twitter / facebook? - twitterSeparating XSLT on a child of a node - xsltVisual Studio 6 cannot load the COM COM library compiled in .net 2.0 - .netКак сделать типы значений без значения null в С#? - referenceРеализация основных функций библиотеки в LISP (вручную) - listRefresh / Refresh tab bar items in ViewController? - iphoneWriting SSIS Variable Variables - sqlWhen using DataTable and DataGrid in WPF System.Windows.Data Error Occurs - c #All Articles