beneroth has quit [Remote host closed the connection]
beneroth has joined #picolisp
Regenaxer has left #picolisp [#picolisp]
Regenaxer has joined #picolisp
<Regenaxer>
(
clacke has joined #picolisp
<beneroth>
Regenaxer, got 5min now? or later.. not urgent
<beneroth>
Guten Morgen =)
<Regenaxer>
Hi beneroth!
<Regenaxer>
Yes, fine now
<beneroth>
I've did the following, using match instead of split. So then I want to ensure that each Pat only has a integer number in it, and not (format "1.1") -> 1
<beneroth>
I've found that (format Arg NIL NIL) works as desired, but if you say this is not intended and not guaranteed for later pil versions, then I guess I go better with split :)
<Regenaxer>
I though of match too, but I think my proposal yesterday is better
<Regenaxer>
not an issue of format behavior
<Regenaxer>
You are right that NIL results in no delimiter
<Regenaxer>
But why use it this way?
<beneroth>
so same in pil21 ?
<Regenaxer>
I don't know how it was in pil64
<beneroth>
it behaves so in my pil64 version
<Regenaxer>
I looked (vi 'format) in pil21
<beneroth>
20.7.4 ugh
<Regenaxer>
then clicked on firstByte
<beneroth>
ah
<Regenaxer>
it returns 0 for NIL
<Regenaxer>
But isn't (mapcar format (split (chop S) ".")) more clear and easier?
<Regenaxer>
Check 4 numbers
<beneroth>
firstCharE_A in pilASM
<beneroth>
but shift+K didn't work on it for me here
<Regenaxer>
hmm, should work
<beneroth>
Regenaxer, yeah, then I halso have to check for 4 numbers :)
<beneroth>
(head -4 (chop S) -> invalid :)
<beneroth>
hmmm
<Regenaxer>
Why are the NIL argments needed?
<beneroth>
try (format "1.1") without
<beneroth>
gets parsed as scale number, and because *Scl not set, results in 1
<Regenaxer>
yes, but with split the dots are gone
<beneroth>
T, only a problem with match
<Regenaxer>
so (split (chop S) ".") must have length 4
<beneroth>
s/with/when using
<beneroth>
T
<Regenaxer>
match is perhaps too permissive
<Regenaxer>
it matches other dots then
<beneroth>
well it eats the rest into the last possible @Pat
<beneroth>
yeah exactly
<beneroth>
good for tolerant parsing
<beneroth>
bad for explicit validation
<Regenaxer>
right, you need further checks, as you do with formay
<Regenaxer>
format
<beneroth>
see, there are some cases where Regex is simpler than universal list matching :)
<beneroth>
exactly
<beneroth>
so question is
<beneroth>
match + format with NIL arguments VS. split + list check + format check
<beneroth>
very minor detail, in any case =D
<Regenaxer>
yes, both are possible
<beneroth>
so my previous question is answered with yes: format handling NIL arguments is well defined and guaranteed
<Regenaxer>
Not really "defined" ;)
<beneroth>
when I saw this, I was not sure if this was indeed intended or implementation luck :)
<Regenaxer>
it behaves the same
<beneroth>
ok, in pil21, but maybe not in pilOS or pil128 :D
<Regenaxer>
I did not think of format with NIL
<beneroth>
ok, so it's undefined, and the observed behaviour is kinda accidental implementation
<Regenaxer>
We *could* define it this way
<Regenaxer>
But isn't split better?
<Regenaxer>
check length
<beneroth>
I tend to think that nothing should be undefined, C proofed that it's messy
<Regenaxer>
then fully format each list
<beneroth>
yeah two separate topics :D
<Regenaxer>
and then format each list
<beneroth>
I switch to split, no need for variables then
<Regenaxer>
yeah
<Regenaxer>
the split list must have length 4, then each of the sublists fully format, then format
<Regenaxer>
I think this is the full check
<beneroth>
but I would like to define the NIL behavior. I think in PicoLisp, function calls with NIL arguments fall into two categories: functions which only care about value/NIL (NIL same as no argument), and functions which first care about presence of arguments and only secondary about their value (NIL is a specific value and not same as missing argument)
<beneroth>
most functions fall into 1. category
<beneroth>
(collect) is example for 2. category
<beneroth>
question: into which category do we place format? current implementation implies 2. category
<Regenaxer>
It is a good question, what is defined for each function?
<Regenaxer>
yes, 2nd
<Regenaxer>
Are there not 3 categories?
<Regenaxer>
or more?
<Regenaxer>
Some functions eval conditionally
<beneroth>
respective to handling of NIL arguments?
<Regenaxer>
also
<Regenaxer>
args may be ignored
<beneroth>
hmmm... then the argument is still not NIL when it's passed
<Regenaxer>
'and' for example
<beneroth>
true
<Regenaxer>
or '+'
<beneroth>
and ?
<Regenaxer>
(and (= 3 4) (mist))
<beneroth>
oh I was not aware of that. (and) ignores undefined function calls?
<Regenaxer>
sure
<Regenaxer>
(if ..) etc
<Regenaxer>
many funs ;)
<beneroth>
wow. I was never aware. or I forgot.
<beneroth>
so they all do practically (when (fun? Arg) (eval ...)) in a way?
<Regenaxer>
no
<Regenaxer>
Evaluation simply stops
<Regenaxer>
like '&&' in C
<beneroth>
ah, breakage.
<beneroth>
I see.
<Regenaxer>
In Pil there are many
<Regenaxer>
Each function has its own behavior
<Regenaxer>
So what is guaranteed?
<Regenaxer>
I think all versions preserved behavior
<Regenaxer>
(mostly I hope)
<beneroth>
I would say: you are right this is also a categorizations of functions, but another dimension that the "categorization of function by how they handle explicitly passed NIL arguments"
<Regenaxer>
yes
<beneroth>
many ideas for Mias blog ;-)
<Regenaxer>
(de f @ vs (de f (A B C)
<Regenaxer>
'@' evaluates all
<beneroth>
but probably not really helping the beginner xD
<Regenaxer>
T
<Regenaxer>
Like Unix commands
<Regenaxer>
each has its own argument interpretation
<beneroth>
(de f (A B C) ....) (f A B C D), so in this function call, D gets never evaluated, because the evaluator checks the target parameter first?
<beneroth>
makes sense.. the checking is to detect mixed handling, eh?
<Regenaxer>
yes, most importantly for FEXPRs
<beneroth>
Regenaxer, re unix commands: T. though its kinda nice that -v being verbose or version and -r being recursive is somewhat consistent. same with -quiet and -h
<beneroth>
yes of course, I understand
<Regenaxer>
An extreme case is 'up' iirc
<Regenaxer>
(up [cnt] sym ['val])
<beneroth>
(unix commands: and theeen you use Solaris or Apple without GNU coreutils, and everything is confusingly different again)
<Regenaxer>
yeah, true
<beneroth>
ah, up combined with set
<beneroth>
I never used that form xD
<beneroth>
ok
<Regenaxer>
I think set is not concerned in 'up'?
<Regenaxer>
ah
<Regenaxer>
you mean the any arg
<Regenaxer>
I meant the cnt vs sym
<beneroth>
about format, so what do we conclude? enshrine the NIL behaviour? if so, I would say we should put a note for that into the reference too, and maybe add a test
<beneroth>
yeah I meant the 'val arg
<Regenaxer>
ok
<Regenaxer>
So yes, NIL is defined behavior for format
<Regenaxer>
I just never thought of that use case
<Regenaxer>
never needed it
<Regenaxer>
But in that regard format is quite normal
<Regenaxer>
NIL means "no separator char"
<beneroth>
yeah so I thought
<Regenaxer>
format is "defined" like all other functions
<Regenaxer>
via the source
<beneroth>
TTTTT
<Regenaxer>
and all Pil versions were simple translations
<Regenaxer>
into other implementation languages
<Regenaxer>
more or less ;)
<beneroth>
<3
<beneroth>
meeting now, so less active here now
<beneroth>
many thanks for the nice discussion :)
<Regenaxer>
Thanks for the contemplation
<beneroth>
you know I like it, maybe sometimes too much ;-)
<Regenaxer>
:)
<beneroth>
I find it's an important point to stress, that people should read source
<beneroth>
this is different to other languages/stack where it's often hopeless to read the source
<beneroth>
this kind of transparency & control is an explicit PicoLisp feature
<Regenaxer>
Exactly
<Regenaxer>
Mia "ordered" me to write an article about reasons to use PicoLisp. This kind of transparency will be an important point
<beneroth>
it is for me.
<beneroth>
minimal dependency on third party
<beneroth>
MS or Siemens or AWS cannot ruin my business
<Regenaxer>
T
<beneroth>
dev fashion cannot ruin my business (see javascript)
<beneroth>
and I can inspect and give guarantees about third party software I use
<beneroth>
(see NPM)
<beneroth>
Regenaxer, you can send me your list for Mia, then I review/extend it and send it back to you, if you like :)
<beneroth>
I guess Mia has also more knowledge about general programming mainstream than you (from school) ? did she already work in software industry?
<Regenaxer>
I have no list for Mia. She thought it up by herself
<Regenaxer>
She worked as an engineer in an automobile supplier, but now also finished batchelor in computer science ("Informatik")
<Regenaxer>
and yes, she has quite a broad knowledge from that
<beneroth>
I see
<beneroth>
yeah no critic on you. that bubble is a privilege :)
<Regenaxer>
I did not see it as a critique
<Regenaxer>
no problem
razzy has quit [Ping timeout: 268 seconds]
<beneroth>
Regenaxer, on one ubuntu machine (accessed via SSH) I've still got the problem of backspace not working in psh console
<beneroth>
in normal (non-psh) repl it works
<beneroth>
psh seems to be in raw mode
<Regenaxer>
I never saw this. Seems a terminal setting
<Regenaxer>
$ stty -a
<beneroth>
exact same output in shell, repl and psh
<beneroth>
very weird
<beneroth>
after the call to (ctty ...) I do (off *Run) (on *Dbg) (load ...) (off *Err) (setq *Prompt "myapp")
<beneroth>
¯\_(ツ)_/¯
<beneroth>
cannot be my code. exact same app has well-behaving psh on other host
Hunar has joined #picolisp
Hunar has quit [Client Quit]
wineroots has joined #picolisp
razzy has joined #picolisp
razzy has quit [Ping timeout: 252 seconds]
razzy has joined #picolisp
razzy has quit [Ping timeout: 260 seconds]
razzy has joined #picolisp
razzy has quit [Ping timeout: 268 seconds]
razzy has joined #picolisp
<Regenaxer>
beneroth, iirc psh does also 'raw'
<Regenaxer>
hmm, no
<beneroth>
well that app will move to another server soonish anyway
<beneroth>
I will test on new server
<Regenaxer>
good
<beneroth>
(different ubuntu versions, different virtualization)
<beneroth>
let's hope there it works better. if not, I have to investigate deeper. but tty is archaic magic.
<Regenaxer>
Perhaps it is virtualization
<beneroth>
weird thing is, pil repl works well
<beneroth>
also when I restart whole application and fork a repl right away
<beneroth>
but not psh
<Regenaxer>
so it is readline()
<beneroth>
cannot be, it's still pil64 :)
<Regenaxer>
ah, right
<Regenaxer>
It must be terminal
<beneroth>
good point, you just say I must update like a enterprise vendor :D
<Regenaxer>
what is sent at BS
<beneroth>
yeah
<Regenaxer>
either ^H or ^?
<beneroth>
^H
<Regenaxer>
8 or 127
<beneroth>
and this is correct, according to stty -a
<beneroth>
(call 'sttty -a)
<beneroth>
no change in shell, pil repl, or psh repl
<Regenaxer>
My stty says "^?"
<Regenaxer>
127
<beneroth>
(sys 'TERM) -> xterm
<Regenaxer>
DEL char in ASCII
<beneroth>
ssh client is MobaXterm on windows
<Regenaxer>
: (key)
<Regenaxer>
-> "^?"
<beneroth>
^H
<beneroth>
ah
<beneroth>
right, good idea with the key
<beneroth>
^H gets printed when I press backspace in psh
<beneroth>
so not interpreted.. so not cooked?
<Regenaxer>
But pil64 @lib/led.l checks (("^H" "^?")
<Regenaxer>
so both should work
<Regenaxer>
line 271 in @lib/led.l
<beneroth>
T
<beneroth>
pil repl TAB-autocompletion works
<beneroth>
it gets weirder and weirder
<beneroth>
(key) -> "^H"
<Regenaxer>
Terminal messes
<beneroth>
T
<beneroth>
anyway, don't mind
<beneroth>
I check new host
<Regenaxer>
ok :)
<beneroth>
:)
<beneroth>
thank you
<beneroth>
if it persists, I study led.l and debug it
wineroots has quit [Read error: Connection reset by peer]
clacke has quit [Read error: Connection reset by peer]
razzy has quit [Ping timeout: 265 seconds]
razzy has joined #picolisp
Regenaxer has quit [Remote host closed the connection]
wineroots has joined #picolisp
beneroth has quit [Remote host closed the connection]