https://github.com/vlad-km/format
function FORMAT from https://github.com.public-domain/cmucl rewrited to JSCL
https://github.com/vlad-km/format
common-lisp format jscl
Last synced: 5 months ago
JSON representation
function FORMAT from https://github.com.public-domain/cmucl rewrited to JSCL
- Host: GitHub
- URL: https://github.com/vlad-km/format
- Owner: vlad-km
- Created: 2023-12-29T14:16:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-12T09:36:02.000Z (over 2 years ago)
- Last Synced: 2025-06-30T07:48:06.679Z (12 months ago)
- Topics: common-lisp, format, jscl
- Language: Common Lisp
- Homepage:
- Size: 255 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Common Lisp function FORMAT
Rewrited FORMAT function from repo https://github.com/public-domain/cmucl
Not included in the standard `JSCL` distribution
Only for Windows/Electron platform. How to use `JSCL` on the `Electron`, see https://github.com/vlad-km/how-to/blob/main/jscl-electron.txt
___
# Status
### Pretty Print - Development
### FORMAT - first release, version 1.0
- `FORMATTER function`* is also included in the release
#### FORMAT directives, included in the release:
- _`~A`_ _`~S`_ _`~C`_
- `~W`
- `~D` `~B` `~O` `~X` `~R` `~F`
- `~P`
- `~%` `~&` `~~` `~#\newline`
- `~*` `~?`
- `~{` `~;` `~^` `~[`
- `~/`
#### See some implementation limitations in the report:
- file `./rep.txt'
___
# Compilation
## development
```lisp
(load "./repo/format/src/format.lisp")
;; or
(require "./format.js")
(load "./repo/format/src/pp/format-pp.lisp")
(load "./repo/format/src/pp/pp.lisp")
```
___
## production
```lisp
(require "./format.js")
(jscl::fset 'format (fdefinition '%das!format))
;; after the command, `DAS!FORMAT' function is called as `FORMAT'
;;`JSCL FORMAT' now is available for use as `JSCL::!FORMAT'
;; (format t "~5&Hello~5%") - ANSII FORMAT
;; (jscl::!format t "~&Hello~&") - JSCL FORMAT
(setq *f1 (formatter "~5&Hello ~a~%"))
(format t *f1 :|any name|)
```
___
# License
Public domain
___
### @vlad-km