List Operations II



Inserting new symbols into a list

  • Create a list

  • (list a_sym b_sym)
  • Insert at the head

  • (cons new_sym a_list)
  • Merge lists

  • (append a_list b_list)


    Examples

      (list 'a 'b)

    (A B)

      (cons 'a '(b c))

    (A B C)

      (append '(a b) '(c d))

    (A B C D)

      (list 'a '(b c) 3 '(a 3.9))

      (setq f1 '(a b c))

      (setq f2 '(d e f))

      (cons 3.5 f1)

      !f1

      (append f1 f2)

      !f1

      !f2

      (setq f1 (cons 3.5 f1))

      !f1

      (setq f1 (append f1 f2))

      !f2

      !f1

    This website has been archived and is no longer maintained.