poke-devel
[Top][All Lists]
Advanced

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

Re: [RFC] Syntax for appending elements to arrays


From: Jose E. Marchesi
Subject: Re: [RFC] Syntax for appending elements to arrays
Date: Fri, 27 Nov 2020 08:47:07 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Adding exceptions and fixing a typo:

([1,2,3]).push (4)

  - Side-effect: [1,2,3] -> [4,1,2,3]
  - Evals to [4,1,2,3]

([1,2,3]).pop

  - Side-effect: [1,2,3] -> [2,3]
  - Evals to 1.
  - Throws E_out_of_bounds if array is empty.

([1,2,3]).put (4)

  - Side-effect: [1,2,3] -> [1,2,3,4]
  - Evals to [1,2,3,4]

([1,2,3]).pull

  - Side-effect: [1,2,3] -> [1,2]
  - Evals to 3
  - Throws E_out_of_bounds if array is empty.



reply via email to

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