This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=LET( | |
BEGIN_LIB_OOP, "smalltalk-style message handler framework", | |
message_match, LAMBDA(expected, LAMBDA(actual, | |
IFERROR((actual = expected), FALSE) | |
)), | |
is_nil, LAMBDA(obj, IFERROR(obj("is_nil__"), FALSE)), | |
as_err_string, LAMBDA(message, fallback_message, | |
IFERROR( | |
CONCAT("", message), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=LET( | |
BEGIN_LIB_BOOL, "standard boolean library", | |
identity_l, LAMBDA(x, x), | |
true_l, LAMBDA(a, LAMBDA(b, a)), | |
false_l, LAMBDA(a, LAMBDA(b, b)), | |
not_l, LAMBDA(a, a(false_l)(true_l)), | |
and_l, LAMBDA(a, LAMBDA(b, a(b)(false_l))), | |
bool_to_literal, LAMBDA(b, b(TRUE)(FALSE)), | |
literal_to_bool, LAMBDA(a, IF(a, true_l, false_l)), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Quine { | |
public static void main(String[] args) { | |
// todo: make it print all the other stuff such as the psvm signature, etc. | |
String s = "String s = %s;System.out.printf(s, (char) 34 + s + (char) 34, ';')%s";System.out.printf(s, (char) 34 + s + (char) 34, ';'); | |
} | |
} |