8000 Release v0.10.0 · skx/yal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

v0.10.0

Compare
Choose a tag to compare
@skx skx released this 15 Oct 11:47
&m 4DE2 iddot; 315 commits to master since this release

This release features the addition of many new primitive functions, whether added to the golang core, or the standard library which is implemented in lisp itself.

New Features

As noted there are a bunch of new functions available:

  • (date)
    • Returns the day of the week, and other fields.
    • Helpers are available (weekday), (day), (month), and (year).
  • (help)
    • This returns any available (optional) help for either our built-in, or lisp-provided functions.
    • The output of everything core is available via yal -h.
  • (time)
    • Returns the time as a list of integers.
    • Helpers are available (hour), (minute), (second), and (hms).
  • Some new list functions were added
    • (butlast), (drop), (every), (repeated), and (take).
  • Some new file/directory functions were added:
    • (glob "pattern") - Returns all filenames that match a pattern.
    • (directory? path) - Return true if the given path exists and is a directory.
    • (exists? path) - Return true if the given path exists.
    • (file? path) - Return true if the given path exists and is a file. (Or rather, is not a directory!)
  • The ability to execute commands upon the system via (shell).

Our standard library was broken into two files stdlib/yal.lisp and stdlib/mal.lisp.

Regressions

Unfortunately our test-coverage is no longer at 100% across all packages, but that will be corrected in the near future.

  • The built-in/special-form (let ..) has been removed, (let* ..) remains.
  • The built-in/special-form (begin ..) has been removed, use (do ..) instead.

Finally our internal "builtin" API changed, to allow golang-primitives to update the environment. This allowed moving (gensym), etc, from the core to the builtin-package.

Future Plans

The next release will build upon the increased I/O primitives available in this release, I think "slurp" will be rewritten with some new file primitives:

  • (file:read "/etc/passwd")
    • This will return the file contents, as a single string.
  • (file:lines "/etc/passwd")
    • This will return a list of strings, one for each line of the given file.
  • (file:stat "/etc/passwd")
    • This will return details about the given file/directory.
      • (file:size), (file:mode) can be written as helpers using that detail. Just like we have (ẁeekday) using details from (date).
  • (directory:walk) will allow invoking a function on every file beneath a path.
    • Using glob and string manipulation is fiddly to use for writing a path-traverser.

With these additions added I _ suspect_ "(hour)" will become "(time:hour)", and similar renaming for the date-based fields. We'll see.

Feedback?

Something missing? A regression broke your buiild? Please file an issue.

0