def ls(pattern, follow_references: true)

            pattern = /#{Regexp.escape(pattern)}/i if pattern.is_a?(::String)
            raise TypeError, "Expected a String or Regexp" unless pattern.is_a?(Regexp)

            self.grep(pattern, streams: false, object_streams: true)
                .select {|object| object.is_a?(Name) and object.parent.is_a?(Dictionary) and object.parent.key?(object) }
                .collect {|object| result = object.parent[object]; follow_references ? result.solve : result }
        end
def ls(pattern, follow_references: true)

            pattern = /#{Regexp.escape(pattern)}/i if pattern.is_a?(::String)
            raise TypeError, "Expected a String or Regexp" unless pattern.is_a?(Regexp)

            self.grep(pattern, streams: false, object_streams: true)
                .select {|object| object.is_a?(Name) and object.parent.is_a?(Dictionary) and object.parent.key?(object) }
                .collect {|object| result = object.parent[object]; follow_references ? result.solve : result }
        end
Returns an array of Objects whose name (in a Dictionary) is matching _pattern_.