On 23/06/14 02:49, Ramana Kumar wrote:
> Is there a nice way to add user printers to pretty-print lists of different
> types differently?
>
> We've tried using add_user_printer on the pattern ``ls:foo list``, but this
> seems to apply the user printer on other kinds of lists as well.
>
> Looking at the implementation of user printers it seems like they are using 
> term
> nets to match against the pattern - are term nets sensitive to types at all?

Term nets don't discriminate on types.  However, add_user_printer is supposed to
be calling match_term to check that the pattern you provide matches, and
match_term certainly does check types.  I see from looking at the code that
there is a bug here (the match_term code is not called at all).  From this, I'd
expect you'd find that your user-printer was being called on all possible terms.

Anyway, I'll fix the bug!  Thanks for the report.

(There is a workaround: check that the argument you get has the right type, and
if it doesn't, raise the UserPP_Failed exception.)

Michael


________________________________

The information in this e-mail may be confidential and subject to legal 
professional privilege and/or copyright. National ICT Australia Limited accepts 
no liability for any damage caused by this email or its attachments.

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
hol-info mailing list
hol-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hol-info

Reply via email to