From dc357ac25a2f79422db2ab41f6f4093a7cbb5d05 Mon Sep 17 00:00:00 2001 From: Raymond Pasco Date: Tue, 15 Sep 2015 02:13:50 -0400 Subject: [PATCH 01/12] update begin syntax in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5947a13967..39c688766b 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ Begin To begin a 32-bit planet use - :?begin + |begin which will guide you through the setup process. From 70b9e5d9c26e7777dbcf456ac0137954d3482337 Mon Sep 17 00:00:00 2001 From: Joan Torres Date: Mon, 14 Sep 2015 11:31:02 -0700 Subject: [PATCH 02/12] Add ++murn jet --- Makefile | 1 + include/jets/q.h | 1 + include/jets/w.h | 1 + jets/b/murn.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ jets/tree.c | 2 ++ 5 files changed, 51 insertions(+) create mode 100644 jets/b/murn.c diff --git a/Makefile b/Makefile index 58a8ec34ad..9ec9c5758d 100644 --- a/Makefile +++ b/Makefile @@ -148,6 +148,7 @@ J_B_OFILES=\ jets/b/lent.o \ jets/b/levy.o \ jets/b/lien.o \ + jets/b/murn.o \ jets/b/need.o \ jets/b/reel.o \ jets/b/roll.o \ diff --git a/include/jets/q.h b/include/jets/q.h index 78de9e2acf..22c64d725b 100644 --- a/include/jets/q.h +++ b/include/jets/q.h @@ -25,6 +25,7 @@ u3_noun u3qb_lent(u3_noun); u3_noun u3qb_levy(u3_noun, u3_noun); u3_noun u3qb_lien(u3_noun, u3_noun); + u3_noun u3qb_murn(u3_noun, u3_noun); u3_noun u3qb_need(u3_noun); u3_noun u3qb_reel(u3_noun, u3_noun); u3_noun u3qb_roll(u3_noun, u3_noun); diff --git a/include/jets/w.h b/include/jets/w.h index 74b02e7410..70e54bd39b 100644 --- a/include/jets/w.h +++ b/include/jets/w.h @@ -24,6 +24,7 @@ u3_noun u3wb_lent(u3_noun); u3_noun u3wb_levy(u3_noun); u3_noun u3wb_lien(u3_noun); + u3_noun u3wb_murn(u3_noun); u3_noun u3wb_need(u3_noun); u3_noun u3wb_reel(u3_noun); u3_noun u3wb_roll(u3_noun); diff --git a/jets/b/murn.c b/jets/b/murn.c new file mode 100644 index 0000000000..08647c4446 --- /dev/null +++ b/jets/b/murn.c @@ -0,0 +1,46 @@ +/* j/2/murn.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qb_murn(u3_noun a, u3_noun b) + { + if ( 0 == a ) { + return a; + } + else if ( c3n == u3du(a) ) { + return u3m_bail(c3__exit); + } + else { + u3_noun one = u3n_slam_on(u3k(b), u3k(u3h(a))); + u3_noun two = u3qb_murn(u3t(a), b); + u3_noun nex; + + switch ( u3ud(one) ) { + case c3y: u3z(one); + return two; + case c3n: nex = u3nc(u3k(u3t(one)), two); + u3z(one); + return nex; + default: u3z(one); + u3z(two); + return u3_none; + } + } + } + u3_noun + u3wb_murn(u3_noun cor) + { + u3_noun a, b; + + if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) ) { + return u3m_bail(c3__exit); + } else { + return u3qb_murn(a, b); + } + } + diff --git a/jets/tree.c b/jets/tree.c index 7b9eda6bae..f87f1acf52 100644 --- a/jets/tree.c +++ b/jets/tree.c @@ -21,6 +21,7 @@ static u3j_harm _mood__hoon_flop_a[] = {{".2", u3wb_flop, c3y}, {}}; static u3j_harm _mood__hoon_lent_a[] = {{".2", u3wb_lent, c3y}, {}}; static u3j_harm _mood__hoon_levy_a[] = {{".2", u3wb_levy, c3y}, {}}; static u3j_harm _mood__hoon_lien_a[] = {{".2", u3wb_lien, c3y}, {}}; +static u3j_harm _mood__hoon_murn_a[] = {{".2", u3wb_murn, c3y}, {}}; static u3j_harm _mood__hoon_need_a[] = {{".2", u3wb_need, c3y}, {}}; static u3j_harm _mood__hoon_reel_a[] = {{".2", u3wb_reel, c3y}, {}}; static u3j_harm _mood__hoon_roll_a[] = {{".2", u3wb_roll, c3y}, {}}; @@ -451,6 +452,7 @@ static u3j_core _mood__hoon_d[] = { "lent", _mood__hoon_lent_a }, { "levy", _mood__hoon_levy_a }, { "lien", _mood__hoon_lien_a }, + { "murn", _mood__hoon_murn_a }, { "need", _mood__hoon_need_a }, { "reel", _mood__hoon_reel_a }, { "roll", _mood__hoon_roll_a }, From dfc529f274ae45e0b0627c066346de56affda7ad Mon Sep 17 00:00:00 2001 From: Joan Torres Date: Wed, 16 Sep 2015 13:29:39 -0700 Subject: [PATCH 03/12] Add ++reap jet --- Makefile | 1 + include/jets/q.h | 1 + include/jets/w.h | 1 + jets/b/reap.c | 41 +++++++++++++++++++++++++++++++++++++++++ jets/tree.c | 2 ++ 5 files changed, 46 insertions(+) create mode 100644 jets/b/reap.c diff --git a/Makefile b/Makefile index 9ec9c5758d..73f9efd661 100644 --- a/Makefile +++ b/Makefile @@ -150,6 +150,7 @@ J_B_OFILES=\ jets/b/lien.o \ jets/b/murn.o \ jets/b/need.o \ + jets/b/reap.o \ jets/b/reel.o \ jets/b/roll.o \ jets/b/skim.o \ diff --git a/include/jets/q.h b/include/jets/q.h index 22c64d725b..b5666e8678 100644 --- a/include/jets/q.h +++ b/include/jets/q.h @@ -27,6 +27,7 @@ u3_noun u3qb_lien(u3_noun, u3_noun); u3_noun u3qb_murn(u3_noun, u3_noun); u3_noun u3qb_need(u3_noun); + u3_noun u3qb_reap(u3_atom, u3_noun); u3_noun u3qb_reel(u3_noun, u3_noun); u3_noun u3qb_roll(u3_noun, u3_noun); u3_noun u3qb_skim(u3_noun, u3_noun); diff --git a/include/jets/w.h b/include/jets/w.h index 70e54bd39b..fc4ea47488 100644 --- a/include/jets/w.h +++ b/include/jets/w.h @@ -26,6 +26,7 @@ u3_noun u3wb_lien(u3_noun); u3_noun u3wb_murn(u3_noun); u3_noun u3wb_need(u3_noun); + u3_noun u3wb_reap(u3_noun); u3_noun u3wb_reel(u3_noun); u3_noun u3wb_roll(u3_noun); u3_noun u3wb_skim(u3_noun); diff --git a/jets/b/reap.c b/jets/b/reap.c new file mode 100644 index 0000000000..87a7d7809f --- /dev/null +++ b/jets/b/reap.c @@ -0,0 +1,41 @@ +/* j/2/reap.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qb_reap(u3_atom a, + u3_noun b) + { + if ( !_(u3a_is_cat(a)) ) { + return u3m_bail(c3__fail); + } + else { + u3_noun acc = u3_nul; + c3_w i_w = a; + + while ( i_w ) { + acc = u3nc(b, acc); + i_w--; + } + + return acc; + } + } + + u3_noun + u3wb_reap(u3_noun cor) + { + u3_noun a, b; + + if ( (c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0)) || + (c3n == u3ud(a)) ) + { + return u3m_bail(c3__exit); + } else { + return u3qb_reap(a, b); + } + } diff --git a/jets/tree.c b/jets/tree.c index f87f1acf52..c7094b4c80 100644 --- a/jets/tree.c +++ b/jets/tree.c @@ -23,6 +23,7 @@ static u3j_harm _mood__hoon_levy_a[] = {{".2", u3wb_levy, c3y}, {}}; static u3j_harm _mood__hoon_lien_a[] = {{".2", u3wb_lien, c3y}, {}}; static u3j_harm _mood__hoon_murn_a[] = {{".2", u3wb_murn, c3y}, {}}; static u3j_harm _mood__hoon_need_a[] = {{".2", u3wb_need, c3y}, {}}; +static u3j_harm _mood__hoon_reap_a[] = {{".2", u3wb_reap, c3y}, {}}; static u3j_harm _mood__hoon_reel_a[] = {{".2", u3wb_reel, c3y}, {}}; static u3j_harm _mood__hoon_roll_a[] = {{".2", u3wb_roll, c3y}, {}}; static u3j_harm _mood__hoon_skim_a[] = {{".2", u3wb_skim, c3y}, {}}; @@ -454,6 +455,7 @@ static u3j_core _mood__hoon_d[] = { "lien", _mood__hoon_lien_a }, { "murn", _mood__hoon_murn_a }, { "need", _mood__hoon_need_a }, + { "reap", _mood__hoon_reap_a }, { "reel", _mood__hoon_reel_a }, { "roll", _mood__hoon_roll_a }, { "skim", _mood__hoon_skim_a }, From 012dabaf6ac6cda6e1f8ebd44cf5364101a502fc Mon Sep 17 00:00:00 2001 From: Joan Torres Date: Sat, 19 Sep 2015 09:50:39 -0700 Subject: [PATCH 04/12] Add ++skid jet --- Makefile | 1 + include/jets/q.h | 1 + include/jets/w.h | 1 + jets/b/skid.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ jets/tree.c | 2 ++ 5 files changed, 49 insertions(+) create mode 100644 jets/b/skid.c diff --git a/Makefile b/Makefile index 73f9efd661..a80d7bf915 100644 --- a/Makefile +++ b/Makefile @@ -153,6 +153,7 @@ J_B_OFILES=\ jets/b/reap.o \ jets/b/reel.o \ jets/b/roll.o \ + jets/b/skid.o \ jets/b/skim.o \ jets/b/skip.o \ jets/b/scag.o \ diff --git a/include/jets/q.h b/include/jets/q.h index b5666e8678..27c24fa5bb 100644 --- a/include/jets/q.h +++ b/include/jets/q.h @@ -30,6 +30,7 @@ u3_noun u3qb_reap(u3_atom, u3_noun); u3_noun u3qb_reel(u3_noun, u3_noun); u3_noun u3qb_roll(u3_noun, u3_noun); + u3_noun u3qb_skid(u3_noun, u3_noun); u3_noun u3qb_skim(u3_noun, u3_noun); u3_noun u3qb_skip(u3_noun, u3_noun); u3_noun u3qb_scag(u3_atom, u3_noun); diff --git a/include/jets/w.h b/include/jets/w.h index fc4ea47488..f46dcafc4d 100644 --- a/include/jets/w.h +++ b/include/jets/w.h @@ -29,6 +29,7 @@ u3_noun u3wb_reap(u3_noun); u3_noun u3wb_reel(u3_noun); u3_noun u3wb_roll(u3_noun); + u3_noun u3wb_skid(u3_noun); u3_noun u3wb_skim(u3_noun); u3_noun u3wb_skip(u3_noun); u3_noun u3wb_scag(u3_noun); diff --git a/jets/b/skid.c b/jets/b/skid.c new file mode 100644 index 0000000000..ac714240e9 --- /dev/null +++ b/jets/b/skid.c @@ -0,0 +1,44 @@ +/* j/2/skid.c +** +*/ +#include "all.h" + + +/* functions +*/ + u3_noun + u3qb_skid(u3_noun a, + u3_noun b) + { + if ( 0 == a ) { + return u3nc(u3_nul, u3_nul); + } + else if ( c3n == u3du(a) ) { + return u3m_bail(c3__exit); + } else { + u3_noun acc = u3qb_skid(u3t(a), b); + u3_noun hoz = u3n_slam_on(u3k(b), u3k(u3h(a))); + + switch ( hoz ) { + case c3y: acc = u3nc(u3nc(u3k(u3h(a)), u3h(acc)), u3t(acc)); + break; + case c3n: acc = u3nc(u3h(acc), u3nc(u3k(u3h(a)), u3t(acc))); + break; + default: u3z(hoz); + return u3m_bail(c3__exit); + } + u3z(hoz); + return acc; + } + } + u3_noun + u3wb_skid(u3_noun cor) + { + u3_noun a, b; + + if ( c3n == u3r_mean(cor, u3x_sam_2, &a, u3x_sam_3, &b, 0) ) { + return u3m_bail(c3__exit); + } else { + return u3qb_skid(a, b); + } + } diff --git a/jets/tree.c b/jets/tree.c index c7094b4c80..ffc5cdba0e 100644 --- a/jets/tree.c +++ b/jets/tree.c @@ -26,6 +26,7 @@ static u3j_harm _mood__hoon_need_a[] = {{".2", u3wb_need, c3y}, {}}; static u3j_harm _mood__hoon_reap_a[] = {{".2", u3wb_reap, c3y}, {}}; static u3j_harm _mood__hoon_reel_a[] = {{".2", u3wb_reel, c3y}, {}}; static u3j_harm _mood__hoon_roll_a[] = {{".2", u3wb_roll, c3y}, {}}; +static u3j_harm _mood__hoon_skid_a[] = {{".2", u3wb_skid, c3y}, {}}; static u3j_harm _mood__hoon_skim_a[] = {{".2", u3wb_skim, c3y}, {}}; static u3j_harm _mood__hoon_skip_a[] = {{".2", u3wb_skip, c3y}, {}}; static u3j_harm _mood__hoon_scag_a[] = {{".2", u3wb_scag, c3y}, {}}; @@ -458,6 +459,7 @@ static u3j_core _mood__hoon_d[] = { "reap", _mood__hoon_reap_a }, { "reel", _mood__hoon_reel_a }, { "roll", _mood__hoon_roll_a }, + { "skid", _mood__hoon_skid_a }, { "skim", _mood__hoon_skim_a }, { "skip", _mood__hoon_skip_a }, { "scag", _mood__hoon_scag_a }, From b9517c23b1ab9e93405ed3363994ab016c79a566 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Tue, 22 Sep 2015 14:04:11 -0700 Subject: [PATCH 05/12] More negative. --- README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 39c688766b..f9385c7dba 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,11 @@ urbit urbit is a new programming and execution environment designed from scratch. -At present urbit is under heavy development. If you're interested in -keeping in touch or following the project you can: +At present urbit is under heavy development. It's not useful for +any external purpose. Documentation is completely inadequate. + +If you're interested in keeping in touch or following the project +you can: - Enter your email address at [urbit.org](http://urbit.org). - Subscribe to the @@ -17,12 +20,12 @@ keeping in touch or following the project you can: All of the source code is distributed under the MIT license, but is for all intents and purposes in the public domain. -Pacakges +Packages -------- #### Ubuntu or Debian -Third-party pacakge files are maintained at https://github.com/yebyen/urbit-deb. Urbit is only supported on Jessie onward. +Third-party package files are maintained at https://github.com/yebyen/urbit-deb. Urbit is only supported on Jessie onward. #### OS X - Homebrew @@ -145,16 +148,12 @@ Use `^x` to switch to the `talk` prompt and then run to join the `urbit-meta` channel. People in there are helpful. -There are four main `talk` commands: +There are three main `talk` commands: ;join ~urbit-name/channel `;join` subscribes your main feed to a remote channel. - ;create channel %name 'description' - -`;create` creates a channel on your urbit. - ; `;` activates a previous message number, like a URL that got @@ -199,7 +198,7 @@ your urbit and: where pier is the name of your pier. While the network is still young from time to time we reboot the entire -thing. We call this a 'continuity breach' since we're breaking the +universe. We call this a 'continuity breach' since we're breaking the continuity of our crypto. When this happens you'll need to back up your data and start a fresh From ba11c0279d6fde7949599cf4cc96bda4e1f53115 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Thu, 24 Sep 2015 16:34:01 -0700 Subject: [PATCH 06/12] More ambiguous. --- README.md | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index f9385c7dba..25ec31108d 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ urbit ===== -urbit is a new programming and execution environment designed from -scratch. +Urbit is a new computing environment designed from scratch. At present urbit is under heavy development. It's not useful for any external purpose. Documentation is completely inadequate. +Anyone can use the interpreter, of course, but the network is +invitation-only. If you're interested in keeping in touch or following the project you can: @@ -17,8 +18,7 @@ you can: - Follow [@urbit_](https://twitter.com/urbit\_) on Twitter. - Get in touch with us via email, -All of the source code is distributed under the MIT license, but is for -all intents and purposes in the public domain. +All of the source code is distributed under the MIT license. Packages -------- @@ -31,8 +31,6 @@ Third-party package files are maintained at https://github.com/yebyen/urbit-deb. brew install --HEAD homebrew/head-only/urbit -If this succeeds, proceed to the [Run section](#run). Otherwise, the build must be done manually: - Dependencies ------------ urbit depends on: @@ -98,27 +96,29 @@ Just run `make`: (On FreeBSD, use `gmake` instead.) -Run +Run (with a network invitation) --- -Inside of the `urbit` directory run +If you have a planet named `~fintud-macrep` and a ticket +`~fortyv-tombyt-tabsen-sonres`, run - bin/urbit -c pier + bin/urbit -w fintud-macrep -t fortyv-tombyt-tabsen-sonres -where `pier` is a directory that does not exist. +Your pier (all Urbit state, log and checkpoint) will be in +`./fintud-macrep`. To restart Urbit: -All your state (an append-only log and a memory checkpoint) will live in -this directory. The name of your pier doesn't matter and is not visible -internally. + bin/urbit fintud-macrep -Begin ------ +Run (without a network invitation) +--- -To begin a 32-bit planet use +Run - |begin + bin/urbit -c mypier -which will guide you through the setup process. +Urbit will create a comet in `mypier`. To restart: + + bin/urbit mypier Basics ------ @@ -140,6 +140,8 @@ turned it off. Talk ---- +If you're on the network, you can use its most basic application, `talk`. + If `talk` is not running, start it with `*talk` from the task manager. Use `^x` to switch to the `talk` prompt and then run @@ -167,7 +169,7 @@ for a private message. Filesystem Sync --------------- -Our filesystem, `%clay` does not automatically sync to unix. If you want +Our filesystem, `%clay`, does not automatically sync to unix. If you want to get files in and out of urbit, you'll need to setup a mount point. Since each mount point is always watching for changes you may also want to unmount from time to time. From f91e79d173dee866389e73f1c45b37594f3370c0 Mon Sep 17 00:00:00 2001 From: Dave Loyall Date: Fri, 25 Sep 2015 17:54:50 -0500 Subject: [PATCH 07/12] Remove bitrotten make target. --- Makefile | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Makefile b/Makefile index a80d7bf915..7160cb2c2d 100644 --- a/Makefile +++ b/Makefile @@ -327,9 +327,6 @@ V_OFILES=\ MAIN_FILE =\ vere/main.o -MEME_FILE =\ - tests/test.o - VERE_OFILES=\ $(CRE2_OFILES) \ $(OUT_OFILES) \ @@ -337,12 +334,6 @@ VERE_OFILES=\ $(MAIN_FILE) \ $(V_OFILES) -MEME_OFILES=\ - $(CRE2_OFILES) \ - $(OUT_OFILES) \ - $(BASE_OFILES) \ - $(MEME_FILE) - VERE_DFILES=$(VERE_OFILES:%.o=.d/%.d) -include $(VERE_DFILES) @@ -388,7 +379,6 @@ all: urbit @echo "# Set custom configuration here, please!" > ".make.conf" urbit: $(BIN)/urbit -meme: $(BIN)/meme $(LIBUV_MAKEFILE) $(LIBUV_MAKEFILE2): cd outside/libuv_0.11 ; sh autogen.sh ; ./configure --disable-dtrace @@ -445,10 +435,6 @@ $(BIN)/urbit: $(LIBCRE) $(LIBCOMMONMARK) $(VERE_OFILES) $(LIBUV) $(LIBRE2) $(LIB @$(CLD) $(CLDOSFLAGS) -o $(BIN)/urbit $(VERE_OFILES) $(LIBUV) $(LIBCRE) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBS) $(LIBCOMMONMARK) $(LIBSCRYPT) $(LIBSOFTFLOAT) endif -$(BIN)/meme: $(LIBCRE) $(LIBCOMMONMARK) $(MEME_OFILES) $(LIBUV) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBSCRYPT) $(LIBSOFTFLOAT) - mkdir -p $(BIN) - $(CLD) $(CLDOSFLAGS) -o $(BIN)/meme $(MEME_OFILES) $(LIBUV) $(LIBCRE) $(LIBRE2) $(LIBED25519) $(LIBANACHRONISM) $(LIBS) $(LIBCOMMONMARK) $(LIBSCRYPT) $(LIBSOFTFLOAT) - tags: ctags -R -f .tags --exclude=root From 32da1b5f1ab346498da07e075b1c50076f0d6999 Mon Sep 17 00:00:00 2001 From: Burton Samograd Date: Fri, 25 Sep 2015 23:38:52 -0600 Subject: [PATCH 08/12] Thread the nock interpreter using computed gotos. --- noun/nock.c | 348 ++++++++++++++++++++++++++-------------------------- 1 file changed, 172 insertions(+), 176 deletions(-) diff --git a/noun/nock.c b/noun/nock.c index 0d2b1ff4ed..af068615ee 100644 --- a/noun/nock.c +++ b/noun/nock.c @@ -133,212 +133,208 @@ _n_nock_on(u3_noun bus, u3_noun fol) u3a_lose(fol); return u3i_cell(poz, riv); } - else switch ( hib ) { - default: return u3m_bail(c3__exit); + else { + static void* lut[] = { + &&l0, &&l1, &&l2, &&l3, &&l4, &&l5, + &&l6, &&l7, &&l8, &&l9, &&l10, &&l11 + }; - case 0: { - if ( c3n == u3r_ud(gal) ) { - return u3m_bail(c3__exit); - } - else { - u3_noun pro = u3k(u3at(gal, bus)); + goto *lut[hib]; + + { + l0: { + if ( c3n == u3r_ud(gal) ) { + return u3m_bail(c3__exit); + } + else { + u3_noun pro = u3k(u3at(gal, bus)); - u3a_lose(bus); u3a_lose(fol); - return pro; - } - } - c3_assert(!"not reached"); + u3a_lose(bus); u3a_lose(fol); + return pro; + } + } - case 1: { - u3_noun pro = u3k(gal); + l1: { + u3_noun pro = u3k(gal); - u3a_lose(bus); u3a_lose(fol); - return pro; - } - c3_assert(!"not reached"); + u3a_lose(bus); u3a_lose(fol); + return pro; + } - case 2: { - u3_noun nex = _n_nock_on(u3k(bus), u3k(u3t(gal))); - u3_noun seb = _n_nock_on(bus, u3k(u3h(gal))); + l2: { + u3_noun nex = _n_nock_on(u3k(bus), u3k(u3t(gal))); + u3_noun seb = _n_nock_on(bus, u3k(u3h(gal))); - u3a_lose(fol); - bus = seb; - fol = nex; - continue; - } - c3_assert(!"not reached"); + u3a_lose(fol); + bus = seb; + fol = nex; + continue; + } - case 3: { - u3_noun gof, pro; + l3: { + u3_noun gof, pro; - gof = _n_nock_on(bus, u3k(gal)); - pro = u3r_du(gof); + gof = _n_nock_on(bus, u3k(gal)); + pro = u3r_du(gof); - u3a_lose(gof); u3a_lose(fol); - return pro; - } - c3_assert(!"not reached"); + u3a_lose(gof); u3a_lose(fol); + return pro; + } - case 4: { - u3_noun gof, pro; + l4: { + u3_noun gof, pro; - gof = _n_nock_on(bus, u3k(gal)); - pro = u3i_vint(gof); + gof = _n_nock_on(bus, u3k(gal)); + pro = u3i_vint(gof); - u3a_lose(fol); - return pro; - } - c3_assert(!"not reached"); + u3a_lose(fol); + return pro; + } - case 5: { - u3_noun wim = _n_nock_on(bus, u3k(gal)); - u3_noun pro = u3r_sing(u3h(wim), u3t(wim)); + l5: { + u3_noun wim = _n_nock_on(bus, u3k(gal)); + u3_noun pro = u3r_sing(u3h(wim), u3t(wim)); - u3a_lose(wim); u3a_lose(fol); - return pro; - } - c3_assert(!"not reached"); + u3a_lose(wim); u3a_lose(fol); + return pro; + } - case 6: { - u3_noun b_gal, c_gal, d_gal; + l6: { + u3_noun b_gal, c_gal, d_gal; - u3x_trel(gal, &b_gal, &c_gal, &d_gal); - { - u3_noun tys = _n_nock_on(u3k(bus), u3k(b_gal)); - u3_noun nex; + u3x_trel(gal, &b_gal, &c_gal, &d_gal); + { + u3_noun tys = _n_nock_on(u3k(bus), u3k(b_gal)); + u3_noun nex; - if ( 0 == tys ) { - nex = u3k(c_gal); - } else if ( 1 == tys ) { - nex = u3k(d_gal); - } else return u3m_bail(c3__exit); + if ( 0 == tys ) { + nex = u3k(c_gal); + } else if ( 1 == tys ) { + nex = u3k(d_gal); + } else return u3m_bail(c3__exit); - u3a_lose(fol); - fol = nex; - continue; - } - } - c3_assert(!"not reached"); + u3a_lose(fol); + fol = nex; + continue; + } + } - case 7: { - u3_noun b_gal, c_gal; + l7: { + u3_noun b_gal, c_gal; - u3x_cell(gal, &b_gal, &c_gal); - { - u3_noun bod = _n_nock_on(bus, u3k(b_gal)); - u3_noun nex = u3k(c_gal); + u3x_cell(gal, &b_gal, &c_gal); + { + u3_noun bod = _n_nock_on(bus, u3k(b_gal)); + u3_noun nex = u3k(c_gal); - u3a_lose(fol); - bus = bod; - fol = nex; - continue; - } - } - c3_assert(!"not reached"); + u3a_lose(fol); + bus = bod; + fol = nex; + continue; + } + } - case 8: { - u3_noun b_gal, c_gal; + l8: { + u3_noun b_gal, c_gal; - u3x_cell(gal, &b_gal, &c_gal); - { - u3_noun heb = _n_nock_on(u3k(bus), u3k(b_gal)); - u3_noun bod = u3nc(heb, bus); - u3_noun nex = u3k(c_gal); + u3x_cell(gal, &b_gal, &c_gal); + { + u3_noun heb = _n_nock_on(u3k(bus), u3k(b_gal)); + u3_noun bod = u3nc(heb, bus); + u3_noun nex = u3k(c_gal); - u3a_lose(fol); - bus = bod; - fol = nex; - continue; - } - } - c3_assert(!"not reached"); + u3a_lose(fol); + bus = bod; + fol = nex; + continue; + } + } - case 9: { - u3_noun b_gal, c_gal; + l9: { + u3_noun b_gal, c_gal; - u3x_cell(gal, &b_gal, &c_gal); - { - u3_noun seb = _n_nock_on(bus, u3k(c_gal)); - u3_noun pro; + u3x_cell(gal, &b_gal, &c_gal); + { + u3_noun seb = _n_nock_on(bus, u3k(c_gal)); + u3_noun pro; - u3t_off(noc_o); - pro = u3j_kick(seb, b_gal); - u3t_on(noc_o); + u3t_off(noc_o); + pro = u3j_kick(seb, b_gal); + u3t_on(noc_o); - if ( u3_none != pro ) { - u3a_lose(fol); - return pro; - } - else { - if ( c3n == u3r_ud(b_gal) ) { - return u3m_bail(c3__exit); - } - else { - u3_noun nex = u3k(u3at(b_gal, seb)); + if ( u3_none != pro ) { + u3a_lose(fol); + return pro; + } + else { + if ( c3n == u3r_ud(b_gal) ) { + return u3m_bail(c3__exit); + } + else { + u3_noun nex = u3k(u3at(b_gal, seb)); - u3a_lose(fol); - bus = seb; - fol = nex; - continue; - } - } - } + u3a_lose(fol); + bus = seb; + fol = nex; + continue; + } + } + } + } + + l10: { + u3_noun p_gal, q_gal; + + u3x_cell(gal, &p_gal, &q_gal); + { + u3_noun zep, hod, nex; + + if ( c3y == u3r_du(p_gal) ) { + u3_noun b_gal = u3h(p_gal); + u3_noun c_gal = u3t(p_gal); + u3_noun d_gal = q_gal; + + zep = u3k(b_gal); + hod = _n_nock_on(u3k(bus), u3k(c_gal)); + nex = u3k(d_gal); + } + else { + u3_noun b_gal = p_gal; + u3_noun c_gal = q_gal; + + zep = u3k(b_gal); + hod = u3_nul; + nex = u3k(c_gal); + } + + u3a_lose(fol); + return _n_hint(zep, hod, bus, nex); + } + } + + l11: { + u3_noun gof = _n_nock_on(bus, u3k(gal)); + u3_noun val; + + u3t_off(noc_o); + val = u3m_soft_esc(u3k(gof)); + u3t_on(noc_o); + + if ( !_(u3du(val)) ) { + u3m_bail(u3nt(1, gof, 0)); + } + else { + u3_noun pro; + + u3z(gof); + u3z(fol); + pro = u3k(u3t(val)); + u3z(val); + + return pro; + } + } } - c3_assert(!"not reached"); - - case 10: { - u3_noun p_gal, q_gal; - - u3x_cell(gal, &p_gal, &q_gal); - { - u3_noun zep, hod, nex; - - if ( c3y == u3r_du(p_gal) ) { - u3_noun b_gal = u3h(p_gal); - u3_noun c_gal = u3t(p_gal); - u3_noun d_gal = q_gal; - - zep = u3k(b_gal); - hod = _n_nock_on(u3k(bus), u3k(c_gal)); - nex = u3k(d_gal); - } - else { - u3_noun b_gal = p_gal; - u3_noun c_gal = q_gal; - - zep = u3k(b_gal); - hod = u3_nul; - nex = u3k(c_gal); - } - - u3a_lose(fol); - return _n_hint(zep, hod, bus, nex); - } - } - - case 11: { - u3_noun gof = _n_nock_on(bus, u3k(gal)); - u3_noun val; - - u3t_off(noc_o); - val = u3m_soft_esc(u3k(gof)); - u3t_on(noc_o); - - if ( !_(u3du(val)) ) { - u3m_bail(u3nt(1, gof, 0)); - } - else { - u3_noun pro; - - u3z(gof); - u3z(fol); - pro = u3k(u3t(val)); - u3z(val); - - return pro; - } - } - c3_assert(!"not reached"); } } } From 31ff27f426a8019ac4e99cdb978da33f05e84bf9 Mon Sep 17 00:00:00 2001 From: Burton Samograd Date: Sat, 26 Sep 2015 13:18:15 -0600 Subject: [PATCH 09/12] Bound check for bad nocks. --- noun/nock.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/noun/nock.c b/noun/nock.c index af068615ee..9fc771dd33 100644 --- a/noun/nock.c +++ b/noun/nock.c @@ -139,6 +139,10 @@ _n_nock_on(u3_noun bus, u3_noun fol) &&l6, &&l7, &&l8, &&l9, &&l10, &&l11 }; + if(hib > 11) { + return u3m_bail(c3__exit); + } + goto *lut[hib]; { From 2f2144e8c502aacbb594d8b72c46c7dd2e3f3bd0 Mon Sep 17 00:00:00 2001 From: Charlie Cummings Date: Sun, 27 Sep 2015 19:00:17 -0400 Subject: [PATCH 10/12] Ask for ticket, close #366 --- vere/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vere/main.c b/vere/main.c index 80d1bd925d..da684a737e 100644 --- a/vere/main.c +++ b/vere/main.c @@ -163,6 +163,13 @@ _main_getopt(c3_i argc, c3_c** argv) return c3n; } + if ( u3_Host.ops_u.tic_c == 0 && u3_Host.ops_u.who_c != 0 ) { + c3_c tic_c[29]; + printf("your ticket: ~"); + scanf("%28s",tic_c); + u3_Host.ops_u.tic_c = _main_presig(tic_c); + } + if ( c3y == u3_Host.ops_u.bat ) { u3_Host.ops_u.dem = c3y; u3_Host.ops_u.nuu = c3y; From 56b0892ba94ba93295ffe91d706f2e5bb9ec242c Mon Sep 17 00:00:00 2001 From: Burton Samograd Date: Mon, 28 Sep 2015 19:07:28 -0600 Subject: [PATCH 11/12] Ignore #file#, which are emacs temp work files. --- vere/unix.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vere/unix.c b/vere/unix.c index 7c111ac802..95c7f381d1 100644 --- a/vere/unix.c +++ b/vere/unix.c @@ -359,7 +359,10 @@ _unix_scan_mount_point(u3_umon* mon_u) else { if ( '.' != out_u->d_name[len_w] || '\0' == out_u->d_name[len_w + 1] - || '~' == out_u->d_name[strlen(out_u->d_name) - 1] ) { + || '~' == out_u->d_name[strlen(out_u->d_name) - 1] + || ('#' == out_u->d_name[0] && + '#' == out_u->d_name[strlen(out_u->d_name) - 1]) + ) { free(pax_c); continue; } @@ -895,6 +898,8 @@ _unix_update_dir(u3_udir* dir_u) if ( !S_ISDIR(buf_u.st_mode) ) { if ( !strchr(out_u->d_name,'.') || '~' == out_u->d_name[strlen(out_u->d_name) - 1] + || ('#' == out_u->d_name[0] && + '#' == out_u->d_name[strlen(out_u->d_name) - 1]) ) { free(pax_c); continue; From f870a09d9d8faecf41464a713e5ced773d78d923 Mon Sep 17 00:00:00 2001 From: Burton Samograd Date: Mon, 28 Sep 2015 19:10:22 -0600 Subject: [PATCH 12/12] Tabs -> spaces. --- vere/unix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vere/unix.c b/vere/unix.c index 95c7f381d1..9998b94b4a 100644 --- a/vere/unix.c +++ b/vere/unix.c @@ -360,8 +360,8 @@ _unix_scan_mount_point(u3_umon* mon_u) if ( '.' != out_u->d_name[len_w] || '\0' == out_u->d_name[len_w + 1] || '~' == out_u->d_name[strlen(out_u->d_name) - 1] - || ('#' == out_u->d_name[0] && - '#' == out_u->d_name[strlen(out_u->d_name) - 1]) + || ('#' == out_u->d_name[0] && + '#' == out_u->d_name[strlen(out_u->d_name) - 1]) ) { free(pax_c); continue; @@ -899,7 +899,7 @@ _unix_update_dir(u3_udir* dir_u) if ( !strchr(out_u->d_name,'.') || '~' == out_u->d_name[strlen(out_u->d_name) - 1] || ('#' == out_u->d_name[0] && - '#' == out_u->d_name[strlen(out_u->d_name) - 1]) + '#' == out_u->d_name[strlen(out_u->d_name) - 1]) ) { free(pax_c); continue;