01:18
theruran has joined #picolisp
04:08
<
geri >
it's such a small thing, not having to write if elif elif ..., but i love lisp's cond
04:29
chexum has quit [Remote host closed the connection]
04:30
chexum has joined #picolisp
04:31
<
abu[7] >
Yeah, cond is simple and beautiful
05:11
rob_w has joined #picolisp
05:45
<
geri >
iirc in original lisp paper there was cond but not if
05:46
<
abu[7] >
setq and cond were "special forms" or so
05:47
<
geri >
actually i dont remember if there was setq at all
05:47
<
abu[7] >
Me neither
05:47
<
geri >
i thought it came to be for practical reasons - cause everyone would use (set (quote Thing))
05:48
<
geri >
(set (quote x) 5), so it became (setq x 5)
05:52
<
geri >
is there a "not member" function, like nond or ifn?
05:53
<
geri >
ill use (not (member ...)) with no sense of shame thne
05:53
<
abu[7] >
all right :)
05:57
<
geri >
its really hard to make let and cond indentation look good for multiline variables/conditions
05:58
<
geri >
lonely paren looks jarring but variables look fine
05:59
<
geri >
cause otherwise it looks like B is a function call
05:59
<
abu[7] >
Better do it like 'pretty'
06:00
<
geri >
its a tad ugly though
06:01
<
geri >
well, so is this honestly :D
06:02
<
geri >
but for that ugliness, picolisp has consistent indentation rules
06:03
<
abu[7] >
oops, last line wrong ;)
06:04
<
geri >
i actually added a let for basename but never used it
06:08
<
geri >
having variable name be on separate line is nice honestly
06:08
<
geri >
then pack is has standard formatting
06:10
<
abu[7] >
There is no perfect style
06:11
<
geri >
what other lisps have sometimes just makes code indent too far
06:12
<
geri >
cause elisp has very long function names, i gotta have function name on new line everywhere to not go over my 80-somethingcolumns
06:12
<
geri >
well, i can change it slightly but still
06:13
<
geri >
arguments aligning one under another can be painful
06:16
chexum has quit [Read error: Connection reset by peer]
06:17
chexum has joined #picolisp
06:42
pablo_escoberg has joined #picolisp
06:44
<
pablo_escoberg >
the above discussion reminds me how critical color is to my code reading. It also reminded me that it's time to get more serious about `vip`. There were a few sample viprc's on the site somewhere, including a silly one that change parenthesis colors on every key press. I'm having a hard time finding these. Can someone point me to them?
06:46
<
abu[7] >
Hmm, I don't remember where this was
06:49
<
pablo_escoberg >
ah, hell. I'll figure it out another way. thanks anyway.
06:57
pablo_escoberg has quit [Ping timeout: 250 seconds]
07:08
<
geri >
im wondering, what's the most meta piece of code youve written as part of picolisp? :D
07:08
<
geri >
like metaprogramming
07:08
<
geri >
or ig not as a part but using picolisp
07:09
<
abu[7] >
Perhaps @src/lib/llvm.l ?
07:10
<
geri >
writing the language in itself is rpetty meta, yeah :D
07:11
<
geri >
in my bash file opener i have a loop that sets functions using eval
07:11
<
geri >
i dont need to do it at all in picolisp cause it has loops but if i do it the same way it doesnt even require any evals
07:11
<
geri >
its just naturally more meta if that makes sense
07:12
<
geri >
(not loops but lists*)
07:13
<
abu[7] >
Good to have such freedom
07:13
<
geri >
eval is so powerful, but when you dont need it to do what you need to do elegantly thats even better
08:12
<
geri >
how are you supposed to use @lib.l alongside your own libraries?
08:12
<
geri >
like you said position of @ is based on the first argument you pass to picolisp interpreter
08:13
<
geri >
so if i want to use picolisp libs alongside my own i cant use @ for both, right?
08:14
<
abu[7] >
You mean loading something else
*instead* of lib.l?
08:14
<
geri >
i could use full paths but thats ugly
08:15
<
geri >
or make my own pil wrapper that defines a "load-a-module-of-mine" function
08:15
<
abu[7] >
You can put a symbolic link into the installation dir
08:15
<
abu[7] >
or that, yes
08:16
<
abu[7] >
I always use local pathes
08:16
<
geri >
like "/home/abu/path/to/libfile.l" ?
08:16
<
abu[7] >
(load "app/lib.l")
08:16
<
geri >
oh, like relative paths
08:17
<
abu[7] >
I avoid absolue ones
08:17
<
geri >
i guess i could do it if i treat picolisp scripts as a separate project
08:17
<
geri >
like in it ill have lib.l with all my useful funcs
08:18
<
abu[7] >
I want to be able to use several pil installations in parallel
08:18
<
geri >
cause youre developing it :D
08:19
<
abu[7] >
For example, I needed pil32 for a while
08:20
<
abu[7] >
Legacy apps
08:20
<
geri >
there are incompatabilities between the rewrites?
08:21
<
abu[7] >
A lot to pil32, but a few also to pil64
08:22
<
geri >
any examples? im curious
08:22
<
abu[7] >
Seems no longer in the relase
08:23
<
geri >
yeah, was boutta say
08:25
<
abu[7] >
Then I used a @lib/compat.l
08:25
<
abu[7] >
A kludge though
08:26
<
geri >
- 'pil' is not needed
08:26
<
geri >
that sounds so sad
08:27
<
geri >
supporting legacy is always a cludge
08:27
<
abu[7] >
You could ask beneroth, I think he still uses pil64 in some cases
08:29
<
geri >
that's from index for "common lisp the language"
08:30
<
geri >
the irony is very strong
08:30
<
abu[7] >
pragmatism
08:36
<
geri >
does relative load work from the path to script or from $PWD when starting it?
08:36
<
geri >
so if my script is in $PATH itll not work properly?
08:38
<
abu[7] >
PATH doen not matter, but PWD when calling it
08:38
<
geri >
im talking about path cause for example in bash
08:38
<
abu[7] >
(if you do relative loads)
08:39
<
geri >
if i have a script called that and call it with bash from ~ like "script -somearg"
08:39
<
abu[7] >
So built-in is only @
08:39
<
geri >
will it fail to load the lib file if it was loaded as (load "lib.l"), thinking lib.l is in the same directory as the script itself?
08:40
<
geri >
a wrapper to (load) it is then
08:40
<
geri >
or wrapper to pil
08:41
<
abu[7] >
You must roll some tactics, yes
08:41
<
abu[7] >
eg, symbolic link
08:42
<
geri >
i cant mess with the installation, its immutable :)
08:42
<
geri >
i could change it in package definition but i may contribute it back to nix some time so not a good idea
08:42
<
abu[7] >
That's why we have local installations ☺
08:43
<
abu[7] >
installation is very small ;)
08:43
<
abu[7] >
Keyboard ;)
08:43
<
geri >
it is, but you need to install llvm and a compiler and some ore stuff
08:45
<
abu[7] >
Is it a problem to wrap 'load'?
08:45
<
abu[7] >
(load (myPath ...
08:46
<
abu[7] >
or (chdir "/myPath" (load ...
08:46
<
geri >
that's a good option
08:47
<
geri >
i have a "make" script for some of my projects, i make sure to cd to $(dirname $0) to know im in the right dir
08:52
chexum has quit [Write error: Broken pipe]
08:52
<
geri >
how do i name a function that checks whether or not extension of a string matches whatever i passed to it?
08:52
chexum has joined #picolisp
08:53
<
geri >
scheme makes me think 'extension=?'
08:54
<
geri >
just gotta rework the function a bit, cause its checking for the dot implicitly
08:55
<
geri >
the on ethat uses (stem (chop N) ".")
09:03
<
geri >
(de suf? (Suffix String)
09:03
<
geri >
(reverse (chop Suffix))
09:03
<
geri >
(reverse (chop String)))
09:03
<
geri >
sorry for spam :D
09:04
<
geri >
this seems to work okay
09:04
<
geri >
except last paren is missing
09:04
<
abu[7] >
I think it is a bit inefficient
09:05
<
geri >
suf? cause opposite of pre?
09:05
<
geri >
any other ideas?
09:05
<
abu[7] >
I would use 'tail'
09:05
<
abu[7] >
'pre?' packs implifitly
09:06
<
abu[7] >
and reverse is also a bit expensive
09:06
<
geri >
okay, let's see
09:06
<
geri >
is length cheap?
09:06
<
abu[7] >
at little better at least
09:07
<
abu[7] >
Why not just (tail Suffix String) ?
09:07
<
geri >
wait it could do that? XD
09:10
<
abu[7] >
I forgot the 'chop' of course
09:10
<
geri >
yeah, i figured :D
09:11
<
geri >
(de suf? (Suffix String) (when (tail (chop Suffix) (chop String)) (pack String)))
09:12
<
geri >
to not get kicked by IRC
09:12
<
geri >
implicit pack to be more in line with pre?
09:13
<
abu[7] >
Here it is explicit, no?
09:13
<
geri >
i thought implicit pack means "you pass a list to a function and its going to return a symbol instead"
09:14
<
geri >
(suf? (chop "hello") (chop "hello, world")) will return "hello, world", not list of chars
09:29
<
geri >
wouldn't changing pre? to have special behaviour when argument evaluates to a symbol make programs more efficient cause less chopping?
09:29
<
geri >
like doing strcmp()
09:29
<
geri >
probably against simplicity though
09:30
<
geri >
or i guess i meant tail in this case
09:36
<
abu[7] >
Hmm, pre? just uses the symbol unchanged
09:37
<
geri >
probably dont want this behaviour to stuff like car and cdr because they're so "low level"
09:38
<
abu[7] >
Yeah, it gets involved and inefficient
09:38
<
geri >
i propose a reader macro or chop B)
09:40
<
geri >
that said, even though code is data in lisps, all of them implement a ' reader macro, but none of them have a reader for eval
09:41
<
geri >
feels assymetric
09:41
<
abu[7] >
The "real" thing is always list processing, so automatic conversion to symbols is just conventional
09:42
<
abu[7] >
How would the syntax be?
09:42
<
geri >
good question
09:43
<
geri >
just wrapping a symbol in parens similarly to picolisp honestly feels like the only logical solution
09:44
<
geri >
but then how do you do functions? idk :D
09:44
<
abu[7] >
I do not really sec what you mean with "reader for eval"
09:45
<
geri >
so @'(+ 1 2) is same as (eval '(+ 1 2))
09:45
<
geri >
(eval (quote (+ 1 2)))
09:46
<
abu[7] >
Not (quote + 1 2) ?
09:46
<
geri >
in picolisp yes, i meant in general lisps
09:47
<
geri >
'A expanding to (quote . A) still feels a little jarring
09:48
<
geri >
but (quote () (+ 1 2 3)) actually feels very natural to me
09:48
<
abu[7] >
(quote . A) is indeed a break with traditions
10:01
rob_w has quit [Remote host closed the connection]
10:10
stultulo is now known as f8l
11:07
msavoritias has joined #picolisp
11:40
<
geri >
are there any symbols left for read macros to occupy? :D
11:45
<
abu[7] >
Well, the unicode space is big :)
13:44
<
abu[7] >
I'm not sure if the quote character can be called a read macro
13:44
<
abu[7] >
It is just a shortcut
13:45
<
abu[7] >
or a syntax feature like the dot in fixnums
13:58
<
geri >
i understand read macros as "you see this char and instead of doing normal things with it you do something else"
13:58
<
geri >
like ` evals stuff in-place, ~ splices the list and just wraps the next expression in (quote )
13:59
<
abu[7] >
But a macro
*does* something. It executes.
13:59
<
geri >
don't macros just translate code
14:00
<
geri >
there can be invalid macros
14:00
<
geri >
like ones that wont be able to run
14:00
<
abu[7] >
Perhapt in C but not in Lisp
14:00
<
abu[7] >
In Lisp a macro evaluatek twice
14:01
<
geri >
i think in lisp the macro gets evaluated once, but the resulting expression is what's evaluated afterwards
14:01
<
abu[7] >
In C too it may be an expression
14:01
<
geri >
and at that second evaluation its no longer a macro
14:01
<
geri >
its just a normal expression
14:45
bjorkintosh has joined #picolisp
14:53
<
geri >
i dont remember if i asked - do you know any other companies using picolisp?
14:55
<
abu[7] >
At the moment I remember 3, and they are here usually
14:55
<
abu[7] >
beneroth, aw- and rob_w
14:55
<
geri >
(plot twist - one you worked in 30 years ago and other two you founded)
14:56
<
geri >
also that soft n nope was funny
14:56
<
geri >
read as nyoup
14:57
<
abu[7] >
wrong input field
14:57
<
geri >
the one finger kb is steno?
14:58
<
abu[7] >
Handrasenmäher
14:58
<
abu[7] >
wrong paste ☺
14:59
<
geri >
is that a grass mower :D
14:59
<
abu[7] >
Docs not finished
14:59
<
geri >
forbidden...
15:00
<
geri >
i had tons of progress at work today, bet everything's gonna crumble now :D
15:03
<
abu[7] >
Fixed permissions
15:04
<
abu[7] >
Out now, must mow ...
15:04
<
geri >
enjoy the sun
15:05
<
geri >
288 combinations? that's like 3 times the normal keyboard
15:05
<
geri >
if you round it, my keyboard doesnt use more than 128 keys
18:51
msavoritias has quit [Ping timeout: 255 seconds]