Home > Software engineering >  Surprisingly valid Ruby syntax: % everywhere
Surprisingly valid Ruby syntax: % everywhere

Time:11-03

In Ruby 2.7 and 3.1 this script does the same thing whether or not the % signs are there:

def count(str)
  state = :start
  tbr = []
  str.each_char do
%             
  •  Tags:  
  • ruby
  • Related