spry is an actively used programming language created in 2015.

4Years Old 384Users 0Jobs
  • spry ranks in the top 50% of languages
  • the spry website
  • spry on github
  • spry first appeared in 2015
  • I have 19 facts about spry. what would you like to know? email me and let me know how I can help.

Example code from the web:

# Let's add a method to:do: that works as in Smalltalk.
# Methods take the first argument, the "receiver", from the left
# and binds it to "self".
to:do: = method [:to :block
  n = self
  [n <= to] whileTrue: [
    do block n
    ..n = (n + 1)]]

# Then we can loop in Smalltalk style echoing 1 to 5!
1 to: 5 do: [echo :x]

# We can similarly implement select: from Smalltalk
select: = method [:pred
  result = ([] clone)
  self reset
  [self end?] whileFalse: [
    n = (self next)
    do pred n then: [result add: n]]
  ^result]

# Then use it to produce [3 4]
echo ([1 2 3 4] select: [:x > 2])

Last updated November 16th, 2019