[ prog / sol / mona ]

prog


cddr

1 2024-04-14 16:06

Do schemers really?

2 2024-04-14 21:38 *

never liked the c[ad][ad]+r thing
lispish languages allow you to define your own cars and cdrs theres no need for the bigger symbols to be set in standard

3 2024-04-14 22:39

Why not? Which one do you prefer `(cdr (cdr x))` or `(cddr x)`

4 2024-04-14 22:46

cdr is an anti-pattern, you should be using list destructuring and pattern matching

5 2024-04-15 05:27

I particularly like the scheme I created for doubly-linked lists: CAR and CDR behave as expected, but there's also CBR, which is the backwards link; this pleasantly uses A, B, C, and D. The code I wrote to generate all CNNR, CNNNR, and CNNNNR functions at READ time wasn't pretty, however.

6 2024-04-15 06:18 *

I think it makes a clearer intention to use first_, second, rest etc on flat lists with a known and finite structure, and car, cdr, cadr etc on recursive functions and on other structures made of conses like trees, usually referred to as ``improper lists''.

7 2024-04-15 06:25

Cniles often say that being terse is good but I don't know... with a proper editor (GNU Emacs + company-mode or similar), you should have some kind of autocomplete feature. Simple abbreviation like CAAR or CADR are easy to understand but it can get out of hand very easily.

8 2024-04-15 19:29 *

>>6
this is also what scheme vectors are but the standard pushes implementations to optimize vectors here
sure they can skit but its less likely to optimize `(caddr x)`

>​7

dimwit cnile says terse is good because their execution environment cant handle more
midwit lipth commoner says terse is bad because modern machines can already handle the sideeffects of worse is better
ivywit schemer says terse is good because it keeps design proper and allows ease of generating strict proofs while they still use a lisp machine like environment to program in their own scheme >>5
and you decided to use a lisp machine like environment thats the worst lisp as an example of a proper editor

9 2024-04-16 21:21 *

>>7,8
I'd agree that making third generic for both vectors and lists is a good idea, while making caddr the same would be stupid.
Terseness is only good up to the point where it remains obvious what something is, and I think lispers/schemers understand this well. I don't think C programmers have a right to engage in a terseness debate when any given C program of around 200 lines could be written in less than 20 lines of Lisp or Scheme with actual semantics. We can hang our hats once an APL programmer shows up.

10 2024-04-17 01:55 *

>>9
can you tersely define for a standard how this third generic gets optimized at a lower and more abstract level where having vectors and improper lists defined is moot
otherwise it doesnt belong in the standard and its something you can already do with scheme
i agree the standard has too many vector bits scheme isnt a shining example of terseness but it departs greatly from the common lipth goop slide into a sink
im waiting for another apl programmer to make an argument but since you understand proper etiquette here
scheme allows some or all if you wish imo macros just fit the case forms of apls shortening while most lipth implementations omit even supporting λ by default
sure you can argue about unicode but some modern apl doesnt
and i will say both of these arent real arguments you can even use a emacs mode for translating long goop into terse symbols locally

Terseness is only good up to the point where it remains obvious what something is

isnt the extreme what cniles broken vocabulary believes terseness is
incomphrenciable goop isnt terseness the word implies theres still a concisely defined subject
Of speech or style: brief, concise, to the point.
Synonyms: concise, succinct
even better it comes from a latin word tersus
clean, neat, rubbed or wiped (off), cleansed, having been cleansed
pure, correct, nice, terse, spruce, neat
is errccwrkprtpwo() any of those you already know the answer
now i will say r7rs-tiny has-a-few-goop-procedures but some of them are justified
call/cc this is cnile i need to know cc means current continuation and / with by looking at it first glance not because i have background information from studying call/cc
instead the emacs mode is justified here as the local programmer i know what symbols i consider equivalent to call-with-current-continuation
sure another solution is a proper (help) but this is something that should already be there especially for standard procedures and now when someone else goes to read it they have to manually look up call/cc
it can be acceptable when the concept needs paragraphs to describe to someone with baseline knowledge in that case call/cc should scream / is with and cc is current continuation but there is no consistent nomenclature where / acts as a combination in r7rs-tiny unlike -> which is even strictly defined to return another type of object
the nice thing about apl is once you understand the graphemes enough and the bases they form things like quadwords its universality accepted how those symbols get used so you arent writing split-at-obtuse-point-five because there is no need and it removes the broken need for verbosity in procedure names
i recommend a glossary using logical graphemes that works with proper lisp environments over split-at-vector-point-five that way someone reading can just hover or something else configured and see the verbose procedure name until they inherit the personal nomenclature the author has for symbols

11 2024-04-17 17:32

My issue is that it is backwards, I know that's how it is when you write things out, but I like piping better.

12 2024-04-17 22:59 *

elaborate upon this http://snow-fort.org/s/fisher.cx/robert/fisherro/pipe/1.0.0/index.html for your preferences relevance

13


VIP:

do not edit these