Libraryless. Click here for Pure Java version (305L/3K/8K).
1 | !7 |
2 | |
3 | static void print_append(StringBuffer buf, String s, int max) { |
4 | x30.print_append(buf, s, max); |
5 | } |
6 | |
7 | // vararg fixer |
8 | static Object callMC(S method, S[] arg) { |
9 | ret callMC(method, new O[] {arg}); |
10 | } |
11 | |
12 | static O callMC(S method, O... args) { |
13 | ret call(mc(), method, args); |
14 | } |
15 | |
16 | static S fixNewLines(S s) { |
17 | ret x30.fixNewLines(s); |
18 | } |
19 | |
20 | ifclass F0 |
21 | static <A> A callF(F0<A> f) { |
22 | ret f == null ? null : f.get(); |
23 | } |
24 | endif |
25 | |
26 | ifclass F1 |
27 | static <A, B> B callF(F1<A, B> f, A a) { |
28 | ret f == null ? null : f.get(a); |
29 | } |
30 | endif |
31 | |
32 | ifclass F2 |
33 | static <A, B, C> C callF(F2<A, B, C> f, A a, B b) { |
34 | ret f == null ? null : f.get(a, b); |
35 | } |
36 | endif |
37 | |
38 | static O callF(O f, O... args) ctex { |
39 | if (f instanceof S) |
40 | ret callMC((S) f, args); |
41 | ifclass DynamicCallable |
42 | if (f instanceof DynamicCallable) |
43 | ret f/DynamicCallable._dyn(args); |
44 | endif |
45 | ret x30.callF(f, args); |
46 | } |
47 | |
48 | static <A> A get(L<A> l, int idx) { |
49 | ret x30.get(l, idx); |
50 | } |
51 | |
52 | static <A> A get(A[] l, int idx) { |
53 | ret x30.get(l, idx); |
54 | } |
55 | |
56 | static bool get(bool[] l, int idx) { |
57 | ret x30.get(l, idx); |
58 | } |
59 | |
60 | static Object get(Object o, String field) { |
61 | ret x30.get(o, field); |
62 | } |
63 | |
64 | static Object get_raw(Object o, String field) { |
65 | ret x30.get_raw(o, field); |
66 | } |
67 | |
68 | static Object get(Class c, String field) { |
69 | ret x30.get(c, field); |
70 | } |
71 | |
72 | static Field get_findStaticField(Class<?> c, String field) { |
73 | ret x30.get_findStaticField(c, field); |
74 | } |
75 | |
76 | static Field get_findField(Class<?> c, String field) { |
77 | ret x30.get_findField(c, field); |
78 | } |
79 | |
80 | static O call(O o) { |
81 | ret callF(o); |
82 | } |
83 | |
84 | static O call(O o, S method, O... args) { |
85 | ret x30.call(o, method, args); |
86 | } |
87 | |
88 | static bool call_checkArgs(Method m, O[] args, bool debug) { |
89 | ret x30.call_checkArgs(m, args, debug); |
90 | } |
91 | |
92 | static <A, B> Map<A, B> newWeakHashMap() { |
93 | ret x30.newWeakHashMap(); |
94 | } |
95 | |
96 | p { |
97 | print("Hello world!"); |
98 | } |
Began life as a copy of #1001167
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): cfunsshuasjs, mqqgnosmbjvj, tvejysmllsmz
No comments. add comment
Snippet ID: | #1016415 |
Snippet name: | JavaX Hello World using standard functions from x30 (outdated method, use x30_util instead) |
Eternal ID of this version: | #1016415/15 |
Text MD5: | 90ec3e2c40454fd22e6758bc56b0b35e |
Transpilation MD5: | 07baabf6dc4ecaaa7ef47e9336f2d978 |
Author: | stefan |
Category: | javax |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | Yes |
Created/modified: | 2018-06-24 16:14:51 |
Source code size: | 1903 bytes / 98 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 421 / 787 |
Version history: | 14 change(s) |
Referenced in: | [show references] |