Is there exists a Dart dynamic type equivalent for Crystal? (Or, equivalent usage)

I guess you can do this?

class BlackHole
  macro method_missing(call)
    raise "BUG: must implement {{call.name}}"
  end
end

array = BlackHole.new
array << 1
array << "hello"
puts array.size
array.each do |x|
  puts x
end

Such type will never make it to the standard library, though.

2 Likes