This website requires JavaScript.
Explore
Help
Register
Sign In
admin
/
j-lang
Watch
1
Star
0
Fork
0
You've already forked j-lang
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Files
d8b4f9b2ea39a124ba85b23b405b9bb0d9728d67
j-lang
/
projects
/
custom_fn.j
8 lines
113 B
Plaintext
Raw
Normal View
History
Unescape
Escape
Add class support with constructors, fields, and methods
2026-02-19 04:24:44 +01:00
x = "Hello world!"
Add user-defined functions with call frames Implement fn/return across the full pipeline: - Lexer: TOK_FN, TOK_RETURN keywords - Parser: NODE_FN_DEF, NODE_RETURN AST nodes - Compiler: FunctionEntry table, inline compilation with jump-over and backpatching - VM: CallFrame stack with variable snapshot for scoped calls and OP_RETURN
2026-02-18 03:16:54 +01:00
Add class support with constructors, fields, and methods
2026-02-19 04:24:44 +01:00
fn suma(x, y):
fn pow(z):
return z * z
return x + pow(y)
println(suma(2, 2))
Reference in New Issue
Copy Permalink