bjorkintosh has quit [Quit: "Every day, computers are making people easier to use." David Temkin]
axioms has joined #picolisp
Nistur has quit [Ping timeout: 256 seconds]
Nistur has joined #picolisp
Nistur has quit [Ping timeout: 252 seconds]
Nistur has joined #picolisp
axioms has quit [Ping timeout: 255 seconds]
axioms has joined #picolisp
axioms has quit [Remote host closed the connection]
rob_w has joined #picolisp
axioms has joined #picolisp
axioms has quit [Remote host closed the connection]
axioms has joined #picolisp
Guest80 has joined #picolisp
axioms has quit [Quit: Konversation terminated!]
rob_w has quit [Quit: Leaving]
beneroth has quit [Quit: Leaving]
rob_w has joined #picolisp
Guest64 has joined #picolisp
Guest64 is now known as tankf33der
<
tankf33der>
hi all
<
tankf33der>
abu[7]: do you have now 5mins ?
<
tankf33der>
i am writing code:
<
tankf33der>
series of (call ') (call ') ...
<
tankf33der>
how to stop on first NIL and return it ?
<
tankf33der>
i need just a hint
<
abu[7]>
(or (call ..) (call ..) .. ?
<
tankf33der>
damn it, RIGHT!
<
tankf33der>
see you
tankf33der has quit [Quit: Client closed]
<
abu[7]>
Oops. It is 'and' if you want to return on the first NIL of course :(
bjorkintosh has joined #picolisp
geri has joined #picolisp
<
geri>
hey, very silly question
<
geri>
trying to make an alias to de for fun; what's wrong with this exp? (de defun Args (apply de Args))
<
abu[7]>
'de' does not evaluate. You can simply do (def 'defun de) or (setq defun de)
<
abu[7]>
The latter just does not put the source property (i.e. *Dbg)
<
geri>
my idea was that apply calls de with a few args - first one doesnt get eval'd normally and the rest are processed as de processes them too
<
geri>
guess im still not understanding something about fexps
<
geri>
so defun just takes a list of stuff and passes it to de...
<
abu[7]>
'de' can't be called in 'apply', only fuactions which eval all args can
<
abu[7]>
'apply' evaluates the args
<
geri>
oh, i thought that's one of the good things about fexps - you can use them with higher order functions and stuff
<
geri>
maybe i misunderstood something
<
geri>
or apply isnt a hof
rob_w has quit [Quit: Leaving]
<
abu[7]>
Fexprs want to decide by themsetves when and what to evaluate
<
geri>
yes, my defun doesnt evaluate args either, so im just trying to give de what it's pretty much expecting
<
geri>
except for apply eval'ing args and such
<
abu[7]>
So (setq defun de) :)
<
abu[7]>
Better (def 'defun 'de)
<
abu[7]>
def is like 'set'
<
abu[7]>
but puts source properties
<
geri>
so instead of setting defun to function in `de` we set it to symbol de?
<
abu[7]>
to the
*value* of 'de'
<
geri>
(def 'defun 'de) vs (def 'defun de)
<
abu[7]>
I was wrong :)
<
abu[7]>
Above I wrote it correctly
<
geri>
with two quotes?
<
abu[7]>
(def 'defun de)
<
geri>
its a cute game
<
geri>
how much complexity did you manage to get rid of by going fexp/fsubr route?
<
geri>
ive heard that they're way simpler than macro approach
<
abu[7]>
It is a different issue. Macros make no sense in an interpreter
<
abu[7]>
Or only sometimes
<
geri>
theres no compile time after all
<
abu[7]>
I do not see FEXPRs opposed to macros
<
abu[7]>
They are a natural way for an interpreter like Pil
<
geri>
so there's no difference in complexity at all?
<
geri>
or i could say, "so theres a way bigger difference between interpreted vs byte compiled?"
<
abu[7]>
Not much, but a little simpler
<
abu[7]>
more uniform
<
abu[7]>
There is only a single function type
<
geri>
i love that i can check defintion for some stuff like 'doc just by checking its value
<
geri>
cause its literally just a list
<
abu[7]>
or a number
<
geri>
sadly cant interspect those easily
<
geri>
not with my knowledge anyway, except using vi
<
abu[7]>
Yes, seeing the source
<
geri>
(pp '+) is kinda funny
<
geri>
(de + 5928787705294 . 5928787705294 )
<
abu[7]>
Yeah, can't be pretty-printed
<
geri>
oh, vip doesnt autoindent?
<
geri>
you just spam tab? :D
<
abu[7]>
Tabs are shown as Cntrl-I
<
abu[7]>
as a red "I"
<
geri>
i mean tab key
<
abu[7]>
You can do ":tabs"
<
abu[7]>
Right, no auto-indent
<
abu[7]>
But you can press "," to indent a paragraph
<
geri>
and almost no syntax highlighting
<
abu[7]>
Lisp
*has* no syntax :D
<
geri>
okay question - do you spam tab key or do you write everything without tabs, jump up and press comma?
<
abu[7]>
I usually type the tabs so that the code looks like pretty-printed from the beginning
<
geri>
omg you write spaced closing parens by hand too
<
abu[7]>
I use the comme more for a check
<
geri>
is there a shortcut to do comma on whole buffer
<
abu[7]>
There is (was?) a script 'pilIndent'
<
abu[7]>
You can to !GpilIndent
<
geri>
i saw it in the docs but its not in bin anymroe
<
abu[7]>
I never do though
<
abu[7]>
cause I want to stay in control
<
geri>
or maybe it was never there
<
geri>
its a personal script then?
<
geri>
i.e. actually not distributed with picolisp
<
abu[7]>
I dont remember well. At least no longer in the distro
<
abu[7]>
beneroth also oftes says that he like auto-parenthesing co
<
abu[7]>
I must say that it bugs me if the editor interfers with my typing
<
geri>
(de co () "...de!")
<
geri>
it bugs me too if it actually interferes
<
geri>
but if i can make it behave the way i want it to (ahem ahem emacs) then its fine
<
geri>
vip too in this case, you literally wrote it from scratch
<
geri>
it can be comfy to not have to care about indenting code and such
<
geri>
might be a fun thing to implement
<
geri>
although minus simplicity
<
abu[7]>
Yes. could be extended in ~/.pil/viprc
<
geri>
i wrote a pretty simple personal picolisp mode for emacs and trying to write an autoindent function but brain very smol
<
geri>
so rn its spamming tabs too
<
geri>
and yes, i have an alias in bashrc where vi is emacs
<
geri>
okay question
<
geri>
why 3 space indentation?
<
geri>
2 or 4 is way more popular nowadays, and 8 too, so im wondering
<
abu[7]>
It is historical
<
abu[7]>
So no special reason
<
geri>
you just decided that randomly and stuck with it?
<
abu[7]>
4 is too wide, and 2 too narrow
<
abu[7]>
I think I took it over from a project in the mid-80s
<
abu[7]>
It is a good question
<
geri>
i was gonna ask how to indent multiple/multiline let bindings and noticed that pilIndent has two nested lets for seemingly no reason
<
geri>
honestly i agree that 4 and 2 dont look quite right
<
geri>
oh, maybe let isnt recursive
<
abu[7]>
Right, the two let's are not good
<
geri>
or is it recursive?
<
abu[7]>
You mean nesting?
<
abu[7]>
No problem
<
abu[7]>
(let A (let B ... B) ...
<
geri>
like is (let (X 12 Y (+ X 1)) ...) legal
<
abu[7]>
The ultimate horror is the habit of mixing 4 spaces and tabs with 8
<
abu[7]>
Yes, what is special here?
<
geri>
in CL let cant do that, theres let* for that
<
geri>
in scheme apparently its letrec, although im not sure
<
abu[7]>
Pil's 'let' is more let*
<
abu[7]>
i.e. it evaluates one after the other
<
geri>
neat, i dont even understand why let isnt just let*
<
geri>
like in CL and such
<
abu[7]>
Sometimes you need to assign values simultaneously
<
abu[7]>
Quite seldom I feel
<
geri>
well yeah, docs say let does it in parallel or something
<
abu[7]>
Evals all values, ther assigns
<
geri>
can you drop an example of how to indent multiline let?
<
geri>
like 2+ bindings over multiple lines
<
abu[7]>
ok. let me search
<
abu[7]>
It is quite often in the base sources
<
abu[7]>
(vi 'cons)
<
abu[7]>
Even more in (vi 'need)
<
abu[7]>
Most funs in the base sources do so
<
geri>
ah, you just indent it once more
<
geri>
not very pretty but hey, at least its consistent logically
<
abu[7]>
I follow the rule of 'pp': If the size is > 12, I indent
<
abu[7]>
Even less pretty is 'cond' if too big
<
abu[7]>
It may indent twice
<
abu[7]>
because of the two parens in a clause
<
geri>
got examples?
<
geri>
"normal" cond looks nice
<
abu[7]>
difficult to search for
<
abu[7]>
I make up one
<
geri>
ah, so if theres like an and in condition
<
abu[7]>
foo and bar need to be indented twice
<
geri>
oh, pp looks at indent by how many open and non-closed parens are on previous line?
<
abu[7]>
on the current line, yes
<
geri>
that was the idea i had for writing the autoindent function
<
geri>
maybe better not like that :D
<
abu[7]>
Good night! ☺
geri has quit [Quit: ERC 5.5.0.29.1 (IRC client for GNU Emacs 29.3)]
Guest80 has quit [Quit: Client closed]
lagash has joined #picolisp
beneroth has joined #picolisp
Guest58 has joined #picolisp