Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1128 from yosoyubik/qeu-fix
Browse files Browse the repository at this point in the history
bug fix in +nap:to
  • Loading branch information
ixv authored Apr 1, 2019
2 parents 965b140 + 346aa84 commit f4ddbc9
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 3 deletions.
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Arvo

A clean-slate operating system.

## Usage

To run Arvo, you'll need [Urbit](https://github.com/urbit/urbit/). To install Urbit and run Arvo please follow the instructions in the [getting started docs](https://urbit.org/docs/getting-started/). You'll be on the live network in a few minutes.

If you're doing development on Arvo, keep reading.

## Documentation

Find Arvo's documentation [on urbit.org](https://urbit.org/docs/learn/arvo/).

## Development

To boot a fake ship from your development files, run `urbit` with the following arguments:

```
urbit -F zod -A /path/to/arvo -c fakezod
```

Mount Arvo's filesystem allows you to update its contents through Unix. To do so, run `|mount` in dojo. It is most common to `|mount /=home=`.

To create a custom pill (bootstrapping object) from the files loaded into the home desk, run `.my/pill +solid`. Your pill will appear in `/path/to/fakezod/.urb/put/my.pill`.

To boot a fake ship with a custom pill, use the `-B` flag:

```
urbit -F zod -A /path/to/arvo -B /path/to.pill -c fakezod
```

To run all tests in `/tests`, run `+test` in dojo. `+test /some/path` would only run all tests in `/tests/some/path`.

## Contributing

Contributions of any form are more than welcome! If something doesn't seem right, and there is no issue about it yet, feel free to open one.

If you're looking to make code contributions, a good place to start might be the [good contributor issues](https://github.com/urbit/arvo/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+contributor+issue%22).

## Maintainers

Most parts of Arvo have dedicated maintainers.

* `/sys/hoon`: @pilfer-pandex (~pilfer-pandex)
* `/sys/zuse`: @pilfer-pandex (~pilfer-pandex)
* `/sys/arvo`: @jtobin (~nidsut-tomdun)
* `/sys/vane/ames`: @belisarius222 (~rovnys-ricfer) & @joemfb (~master-morzod)
* `/sys/vane/behn`: @belisarius222 (~rovnys-ricfer)
* `/sys/vane/clay`: @philipcmonk (~wicdev-wisryt)
* `/sys/vane/dill`: @bernardodelaplaz (~rigdyn-sondur)
* `/sys/vane/eyre`: @eglaysher (~littel-ponnys)
* `/sys/vane/ford`: @belisarius222 (~rovnys-ricfer) & @eglaysher (~littel-ponnys)
* `/sys/vane/gall`: @jtobin (~nidsut-tomdun)
* `/sys/vane/jael`: @fang- (~palfun-foslup) & @joemfb (~master-morzod)
* `/app/acme`: @joemfb (~master-morzod)
* `/app/dns`: @joemfb (~master-morzod)
* `/app/hall`: @fang- (~palfun-foslup)
* `/app/talk`: @fang- (~palfun-foslup)
* `/lib/test`: @eglaysher (~littel-ponnys)

## Contact

We are using our new UI, Landscape, to run a few experimental cities. If you have an Azimuth point, please send us your planet name at [support@urbit.org](mailto:support@urbit.org) to request access.
19 changes: 19 additions & 0 deletions mar/md.hoon
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
::
:::: /hoon/md/mar
::
/? 310
::
=, format
=, mimes:html
|_ txt/wain
::
++ grab :: convert from
|%
++ mime |=({p/mite:eyre q/octs:eyre} (to-wain q.q))
++ noun wain :: clam from %noun
--
++ grow
|%
++ mime [/text/plain (as-octs (of-wain txt))]
--
--
7 changes: 4 additions & 3 deletions sys/hoon.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -1875,9 +1875,10 @@
::
++ nap :: removes head
?> ?=(^ a)
?: =(~ l.a) r.a
=+ b=get(a l.a)
bal(a ^+(a [p.b q.b r.a]))
?~ a ~
=+ b=get
?~ q.b ~
bal(a ^+(a [n=n.q.b l=l.q.b r=r.q.b]))
::
++ put :: insert new tail
|* b/*
Expand Down
51 changes: 51 additions & 0 deletions tests/sys/hoon/qeu.hoon
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
:: test a fix for a bug in +nap:to affecting three-item queues.
::
:: (see https://github.com/urbit/arvo/issues/1100 for details)
::
:: the test creates several queues from known lists and recursively
:: unqueues the top, comparing it with the current element of the list.
::
/+ *test
::
=/ descending ~[7 6 5 4 3 2 1]
=/ ascending ~[1 2 3 4 5 6 7]
=/ unsorted ~[1 6 3 5 7 2 4]
=/ duplicates ~[1 1 7 4 6 9 4]
::
=>
|%
++ unqueue
|= [queue=(qeu @) test=(list @)]
^- tang
%- zing
|- ^- (list tang)
?~ test ~
?~ queue ~
:_ $(queue ~(nap to queue), test t.test)
%+ expect-eq
!> (need ~(top to queue))
!> i.test
--
::
|%
::
++ test-descending-sorted-list ^- tang
::
=+ queue=(~(gas to `(qeu @)`~) descending)
(unqueue [queue descending])
::
++ test-ascending-sorted-list ^- tang
::
=+ queue=(~(gas to `(qeu @)`~) ascending)
(unqueue [queue ascending])
::
++ test-unsorted-list ^- tang
::
=+ queue=(~(gas to `(qeu @)`~) unsorted)
(unqueue [queue unsorted])
::
++ test-duplicates-list ^- tang
::
=+ queue=(~(gas to `(qeu @)`~) duplicates)
(unqueue [queue duplicates])
--

0 comments on commit f4ddbc9

Please sign in to comment.