Source

namespace-newlisp /

Filename Size Date modified Message
src
8 B
8.1 KB
898 B
861 B
3.9 KB
namespace.lsp adds java-like namespaces to newLISP!

You can do stuff like:

	(ns-import 'com.example.*)
	(ns-import 'com.example.Test)

To understand what this is and how it works just follow these steps:

1) Run main.lsp in the project directory.

	[prompt]$ newlisp main.lsp

2) Read main.lsp
3) Look at the directory structure in src/
4) Look inside Bar.lsp, Foo.lsp, and Test.lsp.
5) Learn about Objective newLISP if you haven't already, but this is optional! you don't need to use ObjNL with namespace.lsp if you don't want.

For an even deeper understanding of how it works, look at ns-create and ns-import in namespace.lsp. There's only 2 short functions to get this functionality! The rest is just making sure your directory structure follows the "package path".

I.e. if you've got a context Test and its package path is: com.example.Test
Your Test.lsp file should be inside com/example.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.