From 24b9ae7820e0b478f56ac07a5d7bdd876187d929 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 15 Dec 2018 15:42:27 -0500 Subject: [PATCH] Add doc files to distribution archives. --- Makefile | 2 +- build_win.bat | 3 ++- doc/Introduction.md | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 154295b0..9eeffa93 100644 --- a/Makefile +++ b/Makefile @@ -156,7 +156,7 @@ valtest: $(JANET_TARGET) $(TEST_PROGRAMS) dist: build/janet-dist.tar.gz build/janet-%.tar.gz: $(JANET_TARGET) src/include/janet/janet.h \ - janet.1 LICENSE CONTRIBUTING.md $(JANET_LIBRARY) README.md + janet.1 LICENSE CONTRIBUTING.md $(JANET_LIBRARY) README.md $(wildcard doc/*) tar -czvf $@ $^ ################# diff --git a/build_win.bat b/build_win.bat index 97fca9d6..d12c2631 100644 --- a/build_win.bat +++ b/build_win.bat @@ -70,7 +70,7 @@ exit /b 1 @rem Show help :HELP @echo. -@echo Usage: build_windows [subcommand=clean,help,test] +@echo Usage: build_windows [subcommand=clean,help,test,dist] @echo. @echo Script to build janet on windows. Must be run from the Visual Studio @echo command prompt. @@ -99,6 +99,7 @@ copy README.md dist\README.md copy janet.lib dist\janet.lib copy janet.exp dist\janet.exp copy src\include\janet\janet.h dist\janet.h +xcopy /s doc dist\doc exit /b 0 :TESTFAIL diff --git a/doc/Introduction.md b/doc/Introduction.md index 6df82905..809cd19f 100644 --- a/doc/Introduction.md +++ b/doc/Introduction.md @@ -676,7 +676,8 @@ When combined with the unquote special, we get the desired output. ## Hygiene -Sometime when we write macros, we must generate symbols for local bindings. Consider +Sometime when we write macros, we must generate symbols for local bindings. Ignoring that +it could be written as a function, consider the following macro ```lisp @@ -711,7 +712,7 @@ What happens in the following code? We want the max to be 14, but this will actually evaluate to 12! This can be understood if we expand the macro. You can expand macro once in janet using the `(macex1 x)` function. -(To expand macros until there are no macros left to expand, us `(macex x)`. Be careful, +(To expand macros until there are no macros left to expand, use `(macex x)`. Be careful, janet has many macros, so the full expansion may be almost unreadable). ```lisp @@ -721,7 +722,7 @@ if we expand the macro. You can expand macro once in janet using the `(macex1 x) After expansion, y wrongly refers to the x inside the macro (which is bound to 8) rather than the x defined to be 10. The problem is the reuse of the symbol x inside the macro, which overshadowed the original -meaning of the macro. +binding. Janet provides a general solution to this problem in terms of the `(gensym)` function, which returns a symbol which is guarenteed to be unique and not collide with any symbols defined previously. We can define