Viaken[m] has quit [Remote host closed the connection]
Viaken[m] has joined #picolisp
aw- has joined #picolisp
ubLIX has quit [Quit: ubLIX]
xkapastel has quit [Quit: Connection closed for inactivity]
jibanes has quit [Ping timeout: 245 seconds]
jibanes has joined #picolisp
Samen has joined #picolisp
Samen has left #picolisp [#picolisp]
xkapastel has joined #picolisp
rob_w has joined #picolisp
<
wuehlmaus>
wow, the picolisp.jar file is very small, great!
<
wuehlmaus>
and a happy good day to all, of course!
<
Regenaxer>
Hi wuehlmaus!
<
wuehlmaus>
Hi, Alex!
<
wuehlmaus>
one question: how can i make the following work:
<
wuehlmaus>
(de dostring (a b c) (pack (a (chop c) b)))
<
wuehlmaus>
i want a to be any function
<
wuehlmaus>
so that i can have this whole chop and at last pack mechanism to work with any function
<
wuehlmaus>
possible?
<
Regenaxer>
Remember to use A, B, and C
<
wuehlmaus>
stupid?
<
Regenaxer>
No, it works just like that
<
wuehlmaus>
(dostring tail 2 "hallo")
<
wuehlmaus>
gives MIL
<
Regenaxer>
(de dostring (A B C) (pack (A (chop C) B)))
<
Regenaxer>
right, it is (doString '((L) (tail 2 L)) "hallo")
<
wuehlmaus>
ah, thanks
<
wuehlmaus>
man, it's awesome that help here is that instant :-)
<
Regenaxer>
Not always :)
<
wuehlmaus>
often :-)
<
Regenaxer>
Depends if someone looks
<
wuehlmaus>
how can i make the number optional so that my function works with e.g reverse ?
<
wuehlmaus>
arc has a special function for that but picolisp doesn't it seems
<
Regenaxer>
You mean the '2'?
<
Regenaxer>
It
*does* work with 'reverse'
<
Regenaxer>
(doString reverse "hallo") ?
<
Regenaxer>
How do you mean "optional"?
<
Regenaxer>
doString expects a function, that's all
<
wuehlmaus>
(de doString (Function Number String) (pack (Function Number (chop String))))
<
wuehlmaus>
my function doesn't :-(
<
wuehlmaus>
sorry for being so slow
<
Regenaxer>
no problem!
<
Regenaxer>
How does your function look like?
<
wuehlmaus>
i just pasted it
<
wuehlmaus>
i didn't?
<
Regenaxer>
the value of 'Function'
<
Regenaxer>
(doString tail "hallo") ?
<
Regenaxer>
'Function' is the value of 'tail' then
<
Regenaxer>
I think your first doString was more useful
<
Regenaxer>
Now you can't pass arbitrary functions
<
Regenaxer>
What is bad with (de doString (A B C) (pack (A (chop C) B))) ?
<
Regenaxer>
or perhaps (de doString (Fun B C) (pack (Fun (chop C) B)))
<
Regenaxer>
hmm, the C is a bit useless
<
Regenaxer>
(de doString (Fun Str) (pack (fun (chop Str))))
<
Regenaxer>
this is the most general
<
Regenaxer>
(de doString (Fun Str) (pack (Fun (chop Str))))
<
Regenaxer>
So (doString reverse "hallo") or (doString '((S) (head 3 (tail 7 S))) "hallo")
<
Regenaxer>
you can pass
*any* function taking and returning a list
<
wuehlmaus>
ah lambda functions to the rescue
<
Regenaxer>
yes, though there is no lambda in PicoLisp
<
Regenaxer>
Function in general
<
Regenaxer>
A function is either a number or a list
<
Regenaxer>
see doc/ref.html
<
wuehlmaus>
still old habits :) that's why i like to use quote sometimes to make it more readable
<
wuehlmaus>
but this is just some getting used to thing
<
Regenaxer>
yes, you can quote it (doString 'reverse ...) but it is not necessary, and a tiny little bit slower ;)
<
wuehlmaus>
oh, i don't want it to be slower, now that i know that pil32 is actually slower :-)
<
Regenaxer>
:) but really a very tiny little bit only
<
Regenaxer>
The bottleneck in pil32 are rather the arithmetics, not the interpreter itself
rick42 has joined #picolisp
ubLIX has joined #picolisp
xkapastel has quit [Quit: Connection closed for inactivity]
orivej has quit [Ping timeout: 272 seconds]
<
wuehlmaus>
how can i use a doString to make this here possible: 1) (doString tail 2 "string") 2) (dostring reverse "string") ?
<
wuehlmaus>
for me that is nicer than having do do '((.... :-)
<
wuehlmaus>
in other words, 2 or 3 arguments
xkapastel has joined #picolisp
<
Regenaxer>
You could make an optional second arg
<
Regenaxer>
(de doString (Fun Str . @)
<
Regenaxer>
in fact an arbitrary number of args
<
Regenaxer>
(pack (pass Fun (chop Str))) )
<
Regenaxer>
This causes 'Fun' to be applied 'Str' as the first arg and all ohers following
<
Regenaxer>
For example:
<
Regenaxer>
: (de ttt (Fun Str . @) (pack (pass Fun (chop Str))))
<
Regenaxer>
: (ttt reverse "abcdef")
<
Regenaxer>
-> "fedcba"
<
Regenaxer>
: (ttt '((S N) (tail N S)) "abcdef" 3)
<
Regenaxer>
-> "def"
<
Regenaxer>
I do not see that this is really useful
<
Regenaxer>
I think what you mean is not really a function call
<
Regenaxer>
You want a macro which first
*transforms* the code to something else, an
*then* calls it
rob_w has quit [Quit: Leaving]
<
wuehlmaus>
well, (ttt '((..... is what i don't like that much
<
wuehlmaus>
too stuffed for my tastes :-)
<
wuehlmaus>
(ttt "abcdef" 3) is what i am after ;-)
<
wuehlmaus>
well, nonsense
<
wuehlmaus>
(ttt tail "abcdef" 3)
<
wuehlmaus>
(ttt reverse "abcdef")
orivej has joined #picolisp
libertas has quit [Ping timeout: 245 seconds]
<
beneroth>
hi all - busy day I see :)
<
wuehlmaus>
i have to see so much, yes, i looked at it but i often sadly suck in putting documentation to action :-(
xkapastel has quit [Quit: Connection closed for inactivity]
<
Regenaxer>
wuehlmaus, I think what you want is very unLispy. It might look chic to garble up the arguments, but nobody will understand the flow
<
beneroth>
Regenaxer is probably right in that ^^
<
beneroth>
wuehlmaus, the picolisp documentation is very dense, needs multiple re-readings :)
<
wuehlmaus>
i try to really not get on your nerves, it's hard that ungifted that i am :-)
<
Regenaxer>
No, don't worry!
<
beneroth>
no worries, wuehlmaus :)
<
wuehlmaus>
okay,
*relief*
<
beneroth>
only the people who don't value others time are annoying. but they also don't worry :D
<
beneroth>
s/value/respect ? :)
<
beneroth>
just ask
orivej has quit [Ping timeout: 245 seconds]
orivej has joined #picolisp
<
razzy>
if anyone disected emacs picolisp-REPL. i want collapsable history, or not saving same input. if nobody cared, no problem :]
aw- has quit [Quit: Leaving.]
libertas has joined #picolisp
ubLIX has quit [Quit: ubLIX]
<
tankf33der>
ive added 10000th fibonaci number to math test
<
tankf33der>
passed.
<
Regenaxer>
Cool! Not with the recursive algorithm I presume?
<
tankf33der>
memoization
<
tankf33der>
50k is ok too, 0.2sec and unlimited stack
alexshendi has joined #picolisp
<
beneroth>
impressive
orivej has quit [Ping timeout: 268 seconds]
orivej has joined #picolisp
aw- has joined #picolisp
ubLIX has joined #picolisp