make a new Type of MutableHashTable display its contents

1 view
Skip to first unread message

Andrew Critch

unread,
Jan 2, 2012, 2:43:31 PM1/2/12
to maca...@googlegroups.com
(Any help with this question will be greatly appreciated :)

MutableHashTables by default do not display their contents.  However, a MutableMatrix *does* display a summary of its contents when called.  Now I've defined the type MutableNest by

MutableNest = new Type of MutableHashTable

How can I install a method for displaying a description of a MutableNest whenever it is the output?  More precisely, there seems to be a command, call it "printMutableMatrix", such that whenever an output M occurs which is a mutable matrix, "printMutableMatrix M" is executed (example below).  I'd like to define a command like printMutableNest and tell Macaulay2 to use it to display MutableNests in the same way.  How can I do this?

Thanks for any help!!

--
Critch, Andrew
UC Berkeley
http://math.berkeley.edu/~critch/

Grayson, Daniel R.

unread,
Jan 2, 2012, 3:59:43 PM1/2/12
to maca...@googlegroups.com
Install a method for "net", like this:


i1 : MutableNest = new Type of MutableHashTable

o1 = MutableNest

o1 : Type

i2 : x = new MutableNest

o2 = MutableNest{}

o2 : MutableNest

i3 : net MutableNest := t -> "hi there";

i4 : x

o4 = hi there

o4 : MutableNest

> --
> You received this message because you are subscribed to the Google Groups "Macaulay2" group.
> To post to this group, send email to maca...@googlegroups.com.
> To unsubscribe from this group, send email to macaulay2+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/macaulay2?hl=en.

Andrew Critch

unread,
Jan 2, 2012, 11:01:25 PM1/2/12
to maca...@googlegroups.com
Excellent!!  Thank you very much!!
Reply all
Reply to author
Forward
0 new messages