// A universal hash function that can handle objects of any type. // // The way it's currently implemented, two objects will have the same hash if // all their non-address fields (all the way down) expand to the same sequence // of scalar values. In particular, a container with all zero addresses hashes // to 0. Hopefully this won't be an issue because we are usually hashing // objects of a single type in any given hash table. // // Based on http://burtleburtle.net/bob/hash/hashfaq.html :(before "End Primitive Recipe Declarations") HASH, :(before "End Primitive Recipe Numbers") put(Recipe_ordinal, "hash", HASH); :(before "End Primitive Recipe Checks") case HASH: { if (SIZE(inst.ingredients) != 1) { raise << maybe(get(Recipe, r).name) << "'hash' takes exactly one ingredient rather than '" << inst.original_string << "'\n" << end(); break; } break; } :(before "End Primitive Recipe Implementations") case HASH: { const reagent& input = current_instruction().ingredients.at(0); products.resize(1); products.at<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><title>Python: package ranger.gui</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head><body bgcolor="#f0f0f8"> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> <tr bgcolor="#7799ee"> <td valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="ranger.html"><font color="#ffffff">ranger</font></a>.gui</strong></big></big></font></td ><td align=right valign=bottom ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/code/ranger/ranger/gui/__init__.py">/home/hut/code/ranger/ranger/gui/__init__.py</a></font></td></tr></table> <p></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#aa55cc"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr> <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="ranger.gui.bar.html">bar</a><br> <a href="ranger.gui.color.html">color</a><br> <a href="ranger.gui.colorscheme.html">colorscheme</a><br> </td><td width="25%" valign=top><a href="ranger.gui.context.html">context</a><br> <a href="ranger.gui.curses_shortcuts.html">curses_shortcuts</a><br> <a href="ranger.gui.defaultui.html">defaultui</a><br> </td><td width="25%" valign=top><a href="ranger.gui.displayable.html">displayable</a><br> <a href="ranger.gui.mouse_event.html">mouse_event</a><br> <a href="ranger.gui.ui.html">ui</a><br> </td><td width="25%" valign=top><a href="ranger.gui.widgets.html"><strong>widgets</strong> (package)</a><br> </td></tr></table></td></tr></table> </body></html>