00:37
orivej has quit [Ping timeout: 258 seconds]
01:22
alexshendi has joined #picolisp
01:34
orivej has joined #picolisp
01:46
orivej has quit [Ping timeout: 245 seconds]
03:51
jibanes has quit [Ping timeout: 244 seconds]
03:53
jibanes has joined #picolisp
04:06
grp has quit [Quit: box shutting down...]
04:23
xkapastel has joined #picolisp
06:37
_whitelogger_ has joined #picolisp
06:40
_whitelogger has quit [Ping timeout: 250 seconds]
06:53
_whitelogger has joined #picolisp
07:02
alexshendi has quit [Read error: Connection reset by peer]
07:10
orivej has joined #picolisp
07:33
orivej has quit [Ping timeout: 258 seconds]
08:06
xkapastel has quit [Quit: Connection closed for inactivity]
09:15
orivej has joined #picolisp
09:59
orivej has quit [Ping timeout: 268 seconds]
10:39
rob_w has joined #picolisp
11:26
_whitelogger has joined #picolisp
12:13
m_mans has joined #picolisp
13:10
m_mans has quit [Quit: Leaving.]
14:08
razzy has quit [Ping timeout: 246 seconds]
14:37
m_mans has joined #picolisp
14:47
m_mans has quit [Quit: Leaving.]
15:02
orivej has joined #picolisp
15:03
m_mans has joined #picolisp
15:11
orivej has quit [Ping timeout: 250 seconds]
16:06
m_mans has quit [Quit: Leaving.]
16:18
orivej has joined #picolisp
16:18
xkapastel has joined #picolisp
16:32
orivej has quit [Ping timeout: 250 seconds]
16:51
m_mans has joined #picolisp
17:16
m_mans has quit [Quit: Leaving.]
17:29
pchrist has quit [Quit: leaving]
17:30
pchrist has joined #picolisp
17:51
orivej has joined #picolisp
21:12
alexshendi has joined #picolisp
21:17
<
alexshendi >
Good evening. I have just written my first useful picolisp program (94 lines). Could anyone be so kind to review it? I would like some pro tips.
21:22
orivej has quit [Read error: Connection reset by peer]
21:23
orivej has joined #picolisp
21:42
<
Regenaxer >
Good evening alexshendi!
21:43
<
Regenaxer >
Sure, let us see :)
21:43
<
Regenaxer >
(I've some red wine intus though ;)
21:44
<
alexshendi >
Good evening Regenaxer. Where can I paste it?
21:44
<
Regenaxer >
ix.io ?
21:45
<
Regenaxer >
I use: (out '("curl" "-sF" "f:1=<-" "ix.io") (prinl ...
21:46
<
Regenaxer >
This is a fragment from @lib/vip.l
21:47
<
Regenaxer >
Or pastebin?
21:53
<
alexshendi >
Had to restart my laptop...
21:54
<
Regenaxer >
Is this inspired by the rosettacode bitmap tasks?
21:55
<
alexshendi >
I want to write a raycaster and need to scale textures. This is a first step.
21:56
<
alexshendi >
Didn't know about the bitmap tasks.
21:56
<
Regenaxer >
What is 'any' in 'go1' needed for?
21:56
<
Regenaxer >
'any' is not used normally
21:56
<
alexshendi >
To convert from a symbol to number.
21:57
<
Regenaxer >
Then better use 'format' directly
21:57
<
Regenaxer >
Formally the code looks good
21:58
<
Regenaxer >
I don't understand what it does exactly on the first glan
21:58
<
Regenaxer >
and so late ;)
21:58
<
Regenaxer >
interpolateBilinear : (/ ... 65025)
21:59
<
Regenaxer >
you might consider using (*/ ... 65025)
21:59
<
Regenaxer >
*/ rounds the result
21:59
<
alexshendi >
I was wondering if a list of lists is the right datastructure for a bitmap.
22:00
<
Regenaxer >
well, yes, it is not the most efficient if the bitmap is big
22:00
<
alexshendi >
Maybe a tree (as built by idx) is faster.
22:00
<
Regenaxer >
yes, if access needs to be random
22:01
<
Regenaxer >
another option is 'grid' in @lib/simul.l
22:01
<
Regenaxer >
it allows fast access to neighbors
22:01
<
alexshendi >
Maybe I should add some comments :)
22:02
<
Regenaxer >
or even 'malloc' a plain memory and operate on it with 'native', but that's extreme ;)
22:02
<
Regenaxer >
As I said, the code looks good
22:03
<
Regenaxer >
Some style issues, but that's more a matter of taste
22:03
<
alexshendi >
It is quite fast as it is, even though I only tested it for scaling 64x64 to 64x512
22:04
<
Regenaxer >
(+ Y 1) is just (inc Y)
22:04
<
Regenaxer >
What does 'bitmapGetPixel' do?
22:05
<
Regenaxer >
get a range?
22:05
<
alexshendi >
I am used to hyphen separated function names...
22:05
<
Regenaxer >
Possible in pil too, I have no problem with such names
22:06
<
alexshendi >
it gets the R G B and alpha components as a list.
22:06
<
Regenaxer >
But as pil is case sensitive, they are not so needed
22:06
<
Regenaxer >
(list 1 2 3 4) is unnecessary overhead
22:06
<
Regenaxer >
can be constant (1 2 3 4)
22:07
orivej has quit [Ping timeout: 246 seconds]
22:07
<
Regenaxer >
or use (4 8 12 16) to avoid the multiplication
22:07
orivej_ has joined #picolisp
22:07
<
Regenaxer >
oops, no
22:07
<
alexshendi >
OK, numeric lists don't need to be quoted...
22:07
<
Regenaxer >
X1 is multiplied :)
22:08
<
Regenaxer >
all no real problems
22:08
<
Regenaxer >
Is (copy Pixel) necessary?
22:09
<
Regenaxer >
I have a bit trouble to read the code due to unusual indentation for me
22:10
<
alexshendi >
I figured it would be necessary, so that different fields have different instances of the same list.
22:11
<
Regenaxer >
copy is only needed if you want to avoid destructive modifications
22:12
<
alexshendi >
What happens when I want to (destructively) modify the bitmap later?
22:13
<
Regenaxer >
Then cells in the map are modified
22:14
<
Regenaxer >
For example, I would rewrite:
22:14
<
Regenaxer >
(de bitmapSetPixel (Bitmap X Y Pixel)
22:14
<
Regenaxer >
'((X1 X2)
22:14
<
Regenaxer >
(nth Bitmap (inc Y) (+ (* 4 X) X1))
22:14
<
Regenaxer >
(1 2 3 4)
22:14
<
Regenaxer >
Pixel )
22:14
<
Regenaxer >
Bitmap )
22:15
<
Regenaxer >
(inc Y) and (* 4 X) could be outside the loop
22:15
<
Regenaxer >
but probably no difference in speed
22:16
<
Regenaxer >
Sorry, I'm too sleepy now :)
22:16
<
alexshendi >
Just a question (inc X) does not change X?
22:16
<
Regenaxer >
Let's continue tomorrow or so?
22:17
<
Regenaxer >
(inc 'X) changes it
22:17
<
Regenaxer >
(inc X) is identical to (+ X 1)
22:17
<
alexshendi >
Of course. Thank you for your time.
22:17
<
Regenaxer >
Fun for me :)
22:17
<
Regenaxer >
Good night! :)
22:18
<
alexshendi >
Good night.
23:21
alexshendi has quit [Ping timeout: 246 seconds]
23:40
orivej_ has quit [Ping timeout: 246 seconds]
23:57
orivej has joined #picolisp