python3 lispytest.py
python3 lispy.py factorial.lsp
Source pages are:
https://norvig.com/lispy.htmlhttps://norvig.com/lispy2.html
python3 lispytest.py
python3 lispy.py factorial.lsp
Source pages are:
https://norvig.com/lispy.htmlhttps://norvig.com/lispy2.html| #!/usr/bin/env bash | |
| # Builds mpv & mpv.app on Apple silicon Macs. | |
| # Run this script from the root directory of the mpv repo. | |
| # if anything fails, gtfo | |
| set -ex | |
| meson setup build | |
| meson compile -C build |
| # Manual opt parsing example | |
| # | |
| # Features: | |
| # - supports short and long flags (ie: -v|--verbose) | |
| # - supports short and long key/value options (ie: -f <file> | --filename <file>) | |
| # - supports short and long key/value options with equals assignment (ie: -f=<file> | --filename=<file>) | |
| # - does NOT support short option chaining (ie: -vh) | |
| # - everything after -- is positional even if it looks like an option (ie: -f) | |
| # - once we hit an arg that isn't an option flag, everything after that is considered positional | |
| function optparsing_demo() { |
| using namespace System.Collections | |
| using namespace System.Management.Automation | |
| using namespace System.ComponentModel.DataAnnotations | |
| using namespace System.Runtime.Serialization | |
| class MandatoryProperties { | |
| MandatoryProperties([IDictionary]$properties) { | |
| $this.GetType().GetProperties([System.Reflection.BindingFlags]'Instance,Public') | ForEach-Object { | |
| $propertyName = $PSItem.Name | |
| [bool]$isOptional = $PSItem.GetCustomAttributes([OptionalFieldAttribute], $true).count -gt 0 | |
| if ( |
| /** | |
| * Get offset relative to selector (or window) | |
| * | |
| * @param {HTMLElement} el | |
| * @param {string|undefined} selector if not give, assumes root most (window) | |
| */ | |
| function offsetRelativeTo(el, selector) { | |
| let offsetTop = el.offsetTop; | |
| let offsetLeft = el.offsetLeft; | |
| let offsetParent = el.offsetParent; |
| // Dev switch for loading prev state or force canned eg. | |
| let activateSaveState = true; | |
| let showParseCount = true; | |
| // Prelim sample input, drawn from the cli/src/tests/query_test.rs (as-is, excess space). | |
| const eg = { | |
| lang: 'javascript', | |
| code: ` | |
| class Person { | |
| // the constructor |
| // Copyright (c) 2021 Francesco Mazzoli <f@mazzo.li> | |
| // | |
| // Permission to use, copy, modify, and distribute this software for any | |
| // purpose with or without fee is hereby granted, provided that the above | |
| // copyright notice and this permission notice appear in all copies. | |
| // | |
| // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
| // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
| // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
| // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| class DirectedGraph<T> { | |
| readonly edges: Map<T, Set<T>> = new Map(); | |
| addAll(from: T, ...to: T[]) { | |
| let dependencies = this.edges.get(from); | |
| if (dependencies == null) { | |
| dependencies = new Set(); | |
| this.edges.set(from, dependencies); | |
| } | |
| Sets.addAll(dependencies, to); |
| // | |
| struct TerminalCell | |
| { | |
| // cell index into GlyphTexture, should be two 16-bit (x,y) values packed: "x | (y << 16)" | |
| uint GlyphIndex; | |
| // 0xAABBGGRR encoded colors, nonzero alpha for Foreground indicates to render colored-glyph | |
| // which means use RGB values from GlyphTexture directly as output, not as ClearType blending weights | |
| uint Foreground; |
Download the latest Lua and LuaJIT sources
Create temporary folder for Lua sources.
I assume you would use C:\Temp\ folder.
Visit Lua FTP webpage and download the latest Lua source archive, currently it is lua-5.4.3.tar.gz