<aw->
one of our community members maintains a script that pushes all of Regenaxer's changes there, i think it runs hourly or something
<Regenaxer>
yes, Mansur's setup
<Regenaxer>
the first one
<hunar>
Thanks aw-, I initially found a lot of repositories all with different usernames so I didn't know what is fork or up to date
<Regenaxer>
The other mentioned yesterday is tankf33der`s
<aw->
maybe not hourly, daily i think
<hunar>
Great :)
<aw->
hunar: in that case just pull it from picolisp.com - that's always the latest and most up-to-date anyways
<Regenaxer>
not picolisp.com but software-lab.de
<aw->
err yes, sorry
<hunar>
I will :D
<Regenaxer>
:)
<hunar>
I have a question :) Is there a built in function for converting float to integer? I made this now which works like i want (de floor (X)
<hunar>
(/ X (** 10 *Scl)))
<Regenaxer>
There is no dynamic way I think
<Regenaxer>
only static via read-macros
<Regenaxer>
'(** 10 *Scl) == 1.0
<Regenaxer>
`(** 10 *Scl) == 1.0
<hunar>
Oh, no problem then just wanted to make sure :D
<Regenaxer>
But you are right, it is actually missing
<Regenaxer>
Anyway it always boils down to the aaove exponentiation
<Regenaxer>
I think I never change *Scl within an application
<Regenaxer>
so the problem never arose
<Regenaxer>
At least not within a source file
<Regenaxer>
So setting *Scl at the top of a file usually suffices
<hunar>
I also usually set *Scl once, but loading lib/math.l changes it to 6
<Regenaxer>
Should not
<hunar>
Ah, it doesn't if i defined it :)
<Regenaxer>
yes
<Regenaxer>
(and (=0 *Scl) (scl 6))
<hunar>
No worries then :D
<hunar>
why '(** 10 *Scl) doesn't work inside a function :/
<hunar>
: (scl 3)
<hunar>
-> 3
<hunar>
: (de floor (X) (/ X '(** 10 *Scl)))
<hunar>
-> floor
<hunar>
: (floor 3.123)
<hunar>
!? (/ X '(** 10 *Scl))
<hunar>
(** 10 *Scl) -- Number expected
<Regenaxer>
I mistyped, must be backquote
<Regenaxer>
read macro
<hunar>
Ah right
<hunar>
I should have noticed :)
<Regenaxer>
(de floor (X) (/ X 1.0)) is the same
<hunar>
You're right :/ I'll write yours
alexshe37 has quit [Quit: -a- Connection Timed Out]
alexshendi has joined #picolisp
alexshe93 has joined #picolisp
alexshendi has quit [Ping timeout: 240 seconds]
<hunar>
(setq R (mapcar zero (need 10))) how can I increment an element, I hoped this would work (inc (get R 3))
<Regenaxer>
(mapcar zero (need 10)) is not good, it creates 'need' for nothing
<Regenaxer>
Better (need 10 0)
<Regenaxer>
or (make (do 10 (link 0)))
<Regenaxer>
To increment a list destuctively
<Regenaxer>
(map inc (need 10 0))
<Regenaxer>
: (let L (need 10 0) (map inc L) L)
<Regenaxer>
-> (1 1 1 1 1 1 1 1 1 1)
<Regenaxer>
'inc' takes a 'var'
<Regenaxer>
(inc (cddr L)) increments the 3rd cell
<Regenaxer>
: (inc (cddr L))
<Regenaxer>
: L
<Regenaxer>
-> 2
<Regenaxer>
-> (1 1 2 1 1 1 1 1 1 1)
<hunar>
(need 10 0) is great :D I didn't know it takes another argument
<Regenaxer>
: (cddr L)
<Regenaxer>
-> (2 1 1 1 1 1 1 1)
<Regenaxer>
: (inc @)
<Regenaxer>
-> 3
<Regenaxer>
$: (cddr L)
<Regenaxer>
-> (3 1 1 1 1 1 1 1)
<Regenaxer>
: L
<Regenaxer>
-> (1 1 3 1 1 1 1 1 1 1)
<Regenaxer>
I think I need to explain the concept of 'var' again in next PilCon
<Regenaxer>
: (doc 'need)
<Regenaxer>
(need 'cnt ['lst ['any]]) -> lst
<Regenaxer>
(need 'cnt ['num|sym]) -> lst
<Regenaxer>
:)
<hunar>
I cant use (cddr L) because I need to do some index math ... I made a custom rand and i want to test how much it produces each number, I loop a number of times and each iteration increment what R at (rand 1 10)
<Regenaxer>
then nth instead of cXr
<Regenaxer>
(inc (nth L 999))
<hunar>
Oh, then I also want to see the explanation of var :D nth returns var but get doesnt :/
<Regenaxer>
You can use 'accu for such counting
<Regenaxer>
get returns the value, not the cell
<Regenaxer>
a var is a cell or a symbol
<Regenaxer>
(inc 'A)
<Regenaxer>
(inc (0))
<hunar>
Hmm, now i get it :D thanks .. I'll checkout 'accu