Skip to content

Commit

Permalink
Merge pull request #284 from rwtolbert/example_each
Browse files Browse the repository at this point in the history
add examples for each
  • Loading branch information
sogaiu authored Feb 5, 2025
2 parents 8a31ba5 + 4e733cf commit bc44c63
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/each.janet
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# prints 12345
(each x [1 2 3 4 5] (prin x)) # -> nil

# prints 12345
(each y @[1 2 3 4 5] (prin y)) # -> nil

# prints values from struct in an unspecified order
# 21 -or- 12
(each x {:a 1 :b 2} (prin x)) # -> nil

0 comments on commit bc44c63

Please sign in to comment.