[Ecls-list] Bug: can't print-object hash-table

Stanislav Frolov frolosofsky at gmail.com
Fri Dec 28 10:47:56 UTC 2012


On Friday 28 December 2012 14:32:50 you wrote:
> Stas Boukarev <stassats at gmail.com> writes:
> > Stanislav Frolov <frolosofsky at gmail.com> writes:
> >> It seems to print functions do not call print-object method for
> >> hash-table and other standard types. I would like to see some
> >> human-readable representation of hash tables.
> >> 
> >> (defmethod print-object ((hash hash-table) stream)
> >> 
> >>  (format stream "42"))
> >> 
> >> ;compiled
> >> 
> >> (print (make-hash-table))
> >> ;evaluated => #<hash-table 0b41ef90>
> >> 
> >> Reproduced with latest ECL's version from git.
> > 
> > That's correct, portable programs can't define methods which only
> > specialize on standard classes.
> 
> See the last point:
> http://www.lispworks.com/reference/HyperSpec/Body/11_abab.htm

Thank you. I was misled that ccl and sbcl (with warning) allow this 
definition. And a lot of thanks for the link.




More information about the ecl-devel mailing list