Skip to content

aartaka/advent-of-code-in-cl-loop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code in Loop

This is a repo for my horrible attempts to solve AoC 2021 puzzles with loop and nothing else. By “nothing else” I mean no other big control flow or programming paradigm but loop. This means:

  • No functional transformations: mapcar, reduce, remove etc.
  • No usual iteration: do, dotimes.
  • No assembly-like things: block, tagbody.
  • No recursive functions.
  • No classes/structures.

All (well… most) of those have their loop counterpart that should be used instead. if and similar simple control flow macros are not imposing any paradigm, and thus can be used. Same goes for small built-in functions. Defining separate functions is fine, as long as their body is either a single loop or is less than four lines. Libraries that I use there are restricted to ASDF and UIOP, thus it should run on almost any standard-conformant and ASDF-bundling implementation.

Why?

Loop is the original zero-cost abstraction and the most comprehensive iteration DSL there probably is to programming. If C for loop allows building browsers and OSes, CL loop, with all its strength, should handle anything, right? Advent of Code is a perfect occasion to prove that.

About

Completing Advent of Code 2021 in Common Lisp loop macro.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published