发现了这个:Unlike in Haskell, changing the order of the clauses would not change the meaning of the program, because Hope's pattern matching always favors more specific patterns over less specific ones. (https://en.wikipedia.org/wiki/Hope_programming_language )
问题是怎么判别“ favors more specific patterns over less specific ones”,当我试图实现这个时就发现没原来想的那么简单。
所以暂时还是用Haskell式的以顺序匹配。
有什么办法么?
发现了这个:Unlike in Haskell, changing the order of the clauses would not change the meaning of the program, because Hope's pattern matching always favors more specific patterns over less specific ones. (https://en.wikipedia.org/wiki/Hope_programming_language ) 问题是怎么判别“ favors more specific patterns over less specific ones”,当我试图实现这个时就发现没原来想的那么简单。 所以暂时还是用Haskell式的以顺序匹配。 有什么办法么?