[Python] Python's range() analog in Common Lisp

Discussão em 'Python' iniciado por Stack, Janeiro 16, 2025.

  1. Stack

    Stack Membro Participativo

    How to create a list of consecutive numbers in Common Lisp?

    In other words, what is the equivalent of Python's range function in Common Lisp?

    In Python range(2, 10, 2) returns [2, 4, 6, 8], with first and last arguments being optional. I couldn't find the idiomatic way to create a sequence of numbers, though Emacs Lisp has number-sequence.

    Range could be emulated using loop macro, but i want to know the accepted way to generate a sequence of numbers with start and end points and step.

    Related: Analog of Python's range in Scheme

    Continue reading...

Compartilhe esta Página