How to define (and name) the corresponding safe term comparison predicates in ISO Prolog?

iso_dif/2 is much simpler to implement than a comparison: The built-in \= operator is available You now exactly what arguments to provide to\= Definition Based on your comments, the safe comparison means that the order won’t change if variables in both subterms are instanciated. If we name the comparison lt, we have for example: lt(a(X), … Read more

Sort a Table[] in Lua

A table in Lua is a set of key-value mappings with unique keys. The pairs are stored in arbitrary order and therefore the table is not sorted in any way. What you can do is iterate over the table in some order. The basic pairs gives you no guarantee of the order in which the … Read more

SQL Sorting and hyphens

I learned something new, just like you as well I believe the difference is between a “String Sort” vs a “Word Sort” (ignores hyphen) Sample difference between WORD sort and STRING sort http://andrusdevelopment.blogspot.com/2007/10/string-sort-vs-word-sort-in-net.html From Microsoft http://support.microsoft.com/kb/322112 For example, if you are using the SQL collation “SQL_Latin1_General_CP1_CI_AS”, the non-Unicode string ‘a-c’ is less than the string … Read more