Email list hosting service & mailing list manager

Naming Jakub T. Jankiewicz (05 Nov 2022 21:09 UTC)
Re: Naming Marc Nieper-Wißkirchen (06 Nov 2022 07:12 UTC)
Re: Naming Lassi Kortela (06 Nov 2022 08:51 UTC)

Re: Naming Lassi Kortela 06 Nov 2022 08:51 UTC

> I would not call pattern matching on list destructuring. Those two full name have additional
> word like bind and assignment

"Binding" and "assignment" can be used anywhere you create variables or
change their values.

"Destructuring", as Marc says, means taking elements out of a structure.

"Pattern matching" is a case expression where you can match on the
structure of a collection (the elements in a collection, and their place
in a hierarchy of nested collections).

After you pattern-match, you usually want to do something with the
elements that matched. So almost all pattern-matching systems have
destructuring built in. E.g. regexp groups (a*)(b*) are pattern matching
and back-references \1 \2 are destructuring.

Common Lisp's destructuring-bind can be thought of as a pattern matching
system that matches only one pattern.

> I'm also worried because I've never seen proper destructure-bind in Scheme.

A useful version of destructuring-bind could certainly be written in
Scheme. But it uses Common Lisp's syntax for function arguments, which
the rest of Scheme is currently not using anywhere.