kari 0.1.0

An embeddable programming language, writting in and for Rust
Documentation
# Since `std` is a module, it obviously can't be the place where the module
# system is implemented. This is why we have this prelude. The interpreter
# automatically adds it in front of the top-level module, so it is available
# everywhere, for loading `std` and other modules.

[
	# on stack: string
	caller swap # => scope string
	load eval   # => scope [ [ [ word ] symbol ] ... ]

	# Load module's exported functions into namespace
	[
		# on stack: scope [ [ word ] symbol ]
		[ clone ] dig # => scope scope [ [ word ] symbol ]
		swap append   # => scope [ [ word ] symbol scope ]
		unwrap define # => scope
	]
		map

	# The previous step leaves an empty list.
	drop
]
:import
	define