Would it make sense for "def method" instance evaled on a class to create an instance method?

def in a class definition (where self is Class1) creates an instance
method.

class Class1
def method1
end
end

Class1.new.method1

but if instance evaled on Class1 (self is also Class1), creates a
singleton method.

Class1.instance_eval do
def method2
end
end

Class1.method2

should there perhaps be an exception for classes (for non classes a
singleton method is the only option), where an unqualified def would
create an instance method, same as in class definition?

Hi,

this is the very difference between instance_eval and class_eval: A
“def” expression in instance_eval will always create a singleton method.
If you want an instance method (i. e. the same behaviour as inside a
class body), you have to use class_eval.

This is explained further in the book “The Ruby programming language”: