Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mostly doc updates. And macro improvements. #263

Merged
merged 17 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This configuration file is part of Hissp's test suite,
# Copyright 2019, 2024 Matthew Egan Odendahl
# SPDX-License-Identifier: Apache-2.0
[run]
source=.
omit=
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# File adapted from GitHub's public-domain Python .gitignore file.
# See https://github.com/github/gitignore/blob/main/Python.gitignore
# for their current version. No copyright is claimed on public-domain
# portions.
#
# This configuration file is part of the Hissp source code repository,
# copyright 2019, 2020, 2023, 2024 Matthew Egan Odendahl
# SPDX-License-Identifier: Apache-2.0

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -18,6 +27,7 @@ lib/
lib64/
parts/
sdist/
setup/
var/
wheels/
*.egg-info/
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<!--
Copyright 2019, 2021, 2022, 2023, 2024 Matthew Egan Odendahl
SPDX-License-Identifier: Apache-2.0
-->
## Contributing
There are many ways to contribute to an open-source project,
even without writing code.
Expand Down
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ which are compiled to Python code,
>>> python_code = readerless(hissp_code)
>>> print(python_code)
(lambda name:
print(
'Hello',
name))
print(
'Hello',
name)
)

```
and evaluated by Python.
Expand Down Expand Up @@ -134,13 +135,14 @@ Strings also have a few special cases:
... )
...
>>> print(readerless(adv_hissp_code))
(lambda name='world':(
print(
'Hello,'),
print(
*name.upper(),
sep=':',
file=__import__('sys').stdout))[-1])
(lambda name='world':
(print(
'Hello,'),
print(
*name.upper(),
sep=':',
file=__import__('sys').stdout)) [-1]
)
>>> greetier = eval(readerless(adv_hissp_code))
>>> greetier()
Hello,
Expand Down Expand Up @@ -195,12 +197,14 @@ branch(
0==1,
# thunk
(lambda :
print(
'yes')),
print(
'yes')
),
# thunk
(lambda :
print(
'no')))
print(
'no')
))
>>> eval(expansion)
no

Expand Down Expand Up @@ -405,7 +409,7 @@ which includes Clojure-like persistent data structures.

```EDN
0 ; from garden_of_edn import _this_file_as_main_; """#"
(hissp/_macro_.prelude)
#hissp/prelude .

(defmacro #hissp/$"m#" t (tuple (.extend [(quote pyrsistent/m) (quote .)] t)))
(defmacro #hissp/$"j#" j (complex 0 j))
Expand Down
20 changes: 13 additions & 7 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,19 @@ def evaluate(self, example, parser=Lissp()):
parser.compiler.ns = example.namespace
hissp = parser.reads(lissp)
compiled = parser.compiler.compile(hissp) + "\n"
assert norm_gensym_eq(compiled, python), " \n" + "".join(
context_diff(
norm_gensyms(python),
norm_gensyms(compiled),
fromfile="expected in doc",
tofile="actually compiled to",
)
assert norm_gensym_eq(compiled, python), "".join(
[
" \nGENSYM-NORMALIZED DIFF:\n",
*context_diff(
norm_gensyms(python),
norm_gensyms(compiled),
fromfile="expected in doc",
tofile="actually compiled to",
),
"FULL COMPILATION:\n>>> ",
compiled[:-1].replace("\n", "\n... "),
"\n",
]
)
return super().evaluate(example)

Expand Down
4 changes: 3 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Sphinx-generated file. See https://www.sphinx-doc.org for copyright and license.
# Sphinx generated this file. See https://www.sphinx-doc.org for copyright and license.
# SPDX-License-Identifier: BSD-2-Clause

# Minimal makefile for Sphinx documentation
#

Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright 2023 Matthew Egan Odendahl
Copyright 2023, 2024 Matthew Egan Odendahl
SPDX-License-Identifier: CC-BY-SA-4.0
-->
# Hissp Documentation
Expand All @@ -15,7 +15,7 @@ ${\boldsymbol {\color{royalblue}{(}\color{green}{\textsf -}\color{gold}{)}\color
[**m**] [Community Chat](https://gitter.im/hissp-lang/community)
⭐ [On GitHub (Source Code)](https://github.com/gilch/hissp)
🗪 [Discussions Page](https://github.com/gilch/hissp/discussions)
🕸 [Hissp Wiki](https://github.com/gilch/hissp/wiki)
📖 [Hissp Wiki](https://github.com/gilch/hissp/wiki)

## Building Docs
Hissp proper has no dependencies, but its documentation is built with Sphinx.
Expand Down
35 changes: 31 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
# Adapted from Sphinx configuration template. Changes
# copyright 2019, 2020, 2021, 2022, 2023 Matthew Egan Odendahl
# SPDX-License-Identifier: Apache-2.0
# Adapted from Sphinx configuration template. Modifications
# copyright 2019, 2020, 2021, 2022, 2023, 2024 Matthew Egan Odendahl
# SPDX-License-Identifier: Apache-2.0 AND BSD-2-Clause

# [https://github.com/sphinx-doc/sphinx/blob/v4.2.0/AUTHORS]
# Copyright (c) 2007-2021 by the Sphinx team (see AUTHORS file).
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Configuration file for the Sphinx documentation builder.
#
Expand Down Expand Up @@ -28,7 +55,7 @@
# -- Project information -----------------------------------------------------

project = "Hissp"
copyright = "2019, 2020, 2021, 2022, 2023 Matthew Egan Odendahl"
copyright = "2019, 2020, 2021, 2022, 2023, 2024 Matthew Egan Odendahl"
author = "Matthew Egan Odendahl"


Expand Down
Loading
Loading