mathstodon.xyz is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance for maths people. We have LaTeX rendering in the web interface!

Server stats:

2.7K
active users

#commonlisp

21 posts14 participants0 posts today
Replied to hajovonta

@hajovonta @sigue @nytpu

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.

Replied to hajovonta

@hajovonta @sigue @nytpu

> 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.

Replied to sigue

@sigue @nytpu

> 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.

Replied to Hacker News

@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:

liberapay.com/jackdaniel/
patreon.com/c/jackdaniel_kochm

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!

Liberapayjackdaniel's profile - LiberapayTwo main projects I'm actively working on and I'm a leading developer of are ECL and McCLIM.

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 (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

HAckable Text Input System (HATIS). Contribute to shegeley/hatis development by creating an account on GitHub.
GitHubGitHub - shegeley/hatis: HAckable Text Input System (HATIS)HAckable Text Input System (HATIS). Contribute to shegeley/hatis development by creating an account on GitHub.
Replied in thread

@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