Right.
Documenting requires some self-discipline, too.
May I offer two adages:
If it's not documented, it doesn't exist.
If it's not worth your time documenting your software, is it worth my time figuring out how to use it?
Right.
Documenting requires some self-discipline, too.
May I offer two adages:
If it's not documented, it doesn't exist.
If it's not worth your time documenting your software, is it worth my time figuring out how to use it?
What a useful article! And I completely agree with his introductory comments about the state of #CommonLisp documentation.
vnikolov> never mind that [`loop'] can't do sequences generically
hajovonta> I'm not sure how to interpret that, loop can iterate over lists, arrays, vectors, hashtables, ...
Not _generically_.
With `map', whether the arguments are lists or vectors can be known as late as run time.
With `loop' that must be known no later than compile time.
hajovonta> I can't think of other kind of sequences
By the way, non-vector arrays and hash tables aren't sequences.
(Continued.)
And today in most (though not all) cases the importance of performance is secondary to that of clarity, ease of change, and obviousness of the absence of bugs.
> [`loop'] is more versatile [than `map'] in terms of debugging and error control.
Sometimes at the expense of other qualities, such as clarity.
#ThereAreAlwaysTradeoffs
> I like that we have more options.
Right.
> abandoned map and its brothers when I learned loop has the same performance
Each has its uses and they are seldom equivalent replacements for each other.
For a very quick example,
(map 'list f xs)
is both clearer and more concise than
(loop for x in xs collect (funcall f x))
(never mind that the latter can't do sequences generically)
and so on regarding good use cases for each.
Continued.
> #DylanLang has separate functions for map, map-as, and do.
That is certainly a justifiable different design approach (than #CommonLisp's).
> We don't always learn every construct in a language by staring at the spec.
I'd say "hear about".
Learning is a stronger proposition.
> Frequently (thankfully) it's clear from the argument list
I'd say "(only) seems clear".
> The problem here is that (map nil ...) is completely unintuitive.
Partly, perhaps, but not completely.
This second argument means that it returns nothing, because nothing is of type nil.
Therefore it must be called for side effect.
nytpu@tilde.zone wrote:
<">
How have I only now learned that (map nil ...) in Common Lisp lets you map over an arbitrary sequence for just the side effects?
</">
Didn't you read the documentation about `map' earlier?
So... how about decoding of Ogg Vorbis streams in pure Common Lisp? As in, no C-bindings here (except libao for the final audio output, obviously). All the decoding is done natively in Lisp.
I'll integrate this into #Benben later today.
The code is part of my CL-RemiAudio library: https://chiselapp.com/user/MistressRemilia/repository/cl-remiaudio/
#CommonLisp #lisp #LinuxAudio #vorbis
@h4ckernews I usually have a much simpler requirement: I need to select a field from a JSON structure returned by an API.
I wrote a simple function that recursively iterates the structure, like this:
(select-field '(:node1 :node2 :node3) json-list)
I connected this to the cl-json output.
Works very reliably, although not an optimized approach.
I've created a liberapay account as an alternative to patreon:
https://liberapay.com/jackdaniel/
https://www.patreon.com/c/jackdaniel_kochmanski
I'm creating Common Lisp Free Software, most involved with #ecl and #mcclim development, but also contributing to other projects when I see fit.
Please consider supporting me financially so my work is sustainable. Cheers!
P.S. My (non-authoritative) reading of the specification is that JavaScript tagged templates (function calls of backquote-delimited forms) can _only_ be _literals_ and can't be constructed at runtime.
Therefore I would definitely avoid an explicit call to `eval' in the lisp translation and just arrange for the placeholder expressions to be in for-evaluation positions.
Hey, ruricolist isn't on the mastodon, are they? I kinda want to use #spinneret (https://github.com/ruricolist/spinneret still on github I guess :( ). Does anyone else have any strong html generator feelings? #commonLisp #webdev #web0
#commonLisp #eev #emacs #eepitch
* (setq eepitch-buffer-name "*slime-repl sbcl*")
"a"
"b"
(concatenate 'string * **)
<F8> <F8> <F8> <F8>
--and over in the repl:
CL-USER> "a"
"a"
CL-USER> "b"
"b"
CL-USER> (concatenate 'string ** *)
"ab"
The S-expression version seems to me to have too much nesting and extra quoting.
tealeg@mastodon.online> the specific macro expansion can differ though, right?
Yes, and it often does (and it may well contain implementation-specific items, of course).
And `macroexpand' is certainly a good way to explore things; just consult the specification as well (in this case the excellent Hyperspec, CLHS).
Recently I've researched the source code of #lem (#commonlisp #emacs alike #text #editor) and #nyxt (#commonisp #browser) and they are truly a pieces of art.
I mean: a complete disaster from UI point of view, but so damn awesome as a possible platform. Did this while harvesting inspiration for my semi-abandoned #hatis (https://hatis.xyz/). Don't worry my dear, I'll get back 2y
Needed to see how event-loop with key pressing & bindings are handled elsewhere + research integrations ideas
@me I guess you could fairly easily write a macro that automatically created a lexical scope and added some prefixes to variable used within its body - Doug Hoyte's "Let over lambda" book has #CommonLisp examples of this kind of approach as way to cut down the syntactic overhead of using gensym in macros. Without much thought, I'd assume something similar could be done in #EmacsLisp