00:15
ccox has quit [Ping timeout: 248 seconds]
00:22
mmu_man has quit [Ping timeout: 252 seconds]
00:27
raboof has quit [Server closed connection]
00:28
raboof has joined #openscad
00:32
califax has quit [Remote host closed the connection]
00:33
cart_man has quit [Quit: Konversation terminated!]
00:34
califax has joined #openscad
01:02
ccox has joined #openscad
01:41
sertsa has joined #openscad
02:01
sculptor2 has joined #openscad
02:05
sculptor has quit [Ping timeout: 245 seconds]
02:17
J25K63 has joined #openscad
02:18
sculptor__ has joined #openscad
02:20
J25K has quit [Ping timeout: 250 seconds]
02:21
sculptor2 has quit [Ping timeout: 248 seconds]
02:25
JoelJoel is now known as Joel
02:53
jbd has quit [Ping timeout: 244 seconds]
03:55
sculptor2 has joined #openscad
03:58
sculptor__ has quit [Ping timeout: 260 seconds]
03:59
sculptor2 has quit [Read error: Connection reset by peer]
04:00
sculptor2 has joined #openscad
04:45
Guest30 has joined #openscad
04:45
Guest30 has quit [Client Quit]
05:12
sculptor2 has quit [Ping timeout: 256 seconds]
05:27
Non-ICE has quit [Ping timeout: 256 seconds]
05:44
Non-ICE has joined #openscad
06:22
sertsa has quit [Quit: sertsa]
07:09
Chancer has joined #openscad
07:12
Chancer has quit [Client Quit]
07:35
hyperair has quit [Remote host closed the connection]
07:35
hyperair has joined #openscad
07:38
Grumpy has joined #openscad
07:38
Grumpy has quit [Client Quit]
07:39
MichaelMMulligan has joined #openscad
07:39
Chancer has joined #openscad
07:39
Chancer has quit [Changing host]
07:39
Chancer has joined #openscad
07:40
Chancer has quit [Client Quit]
07:40
Chancer has joined #openscad
07:46
MichaelMMulligan has quit [Quit: Client closed]
07:56
Chancer has quit [Quit: Chancer]
07:56
Chancer has joined #openscad
07:56
Chancer has joined #openscad
07:56
Chancer has quit [Changing host]
07:57
mmu_man has joined #openscad
08:06
manzhiluo has joined #openscad
08:19
manzhiluo has quit [Quit: Client closed]
08:31
oldlaptop has quit [Server closed connection]
08:31
oldlaptop has joined #openscad
08:47
mmu_man has quit [Ping timeout: 256 seconds]
09:11
Chancer has quit [Ping timeout: 248 seconds]
09:27
mmu_man has joined #openscad
09:32
Chancer has joined #openscad
09:35
mmu_man has quit [Ping timeout: 256 seconds]
11:02
Chancer has quit [Quit: Chancer]
11:14
J25K63 has quit [Quit: Client closed]
11:15
J25K63 has joined #openscad
11:57
howiemnt1 has joined #openscad
11:58
howiemnt has quit [Ping timeout: 256 seconds]
12:03
snaked has quit [Quit: Leaving]
12:29
jbd has joined #openscad
13:02
howiemnt1 has quit [Ping timeout: 256 seconds]
13:06
howiemnt has joined #openscad
14:37
sculptor has joined #openscad
15:51
hyperair has quit [Remote host closed the connection]
16:01
hyperair has joined #openscad
16:07
TheAssass1n has joined #openscad
16:07
TheAssassin has quit [Ping timeout: 272 seconds]
17:08
joseph_ has quit [Server closed connection]
17:09
joseph_ has joined #openscad
17:20
Chancer has joined #openscad
17:22
Ckat has quit [Server closed connection]
17:22
Ckat has joined #openscad
17:59
mmu_man has joined #openscad
18:28
tcurdt has quit [Server closed connection]
18:28
tcurdt has joined #openscad
19:16
Chancer has quit [Quit: Chancer]
19:44
Adrianh has joined #openscad
19:49
<
Adrianh >
Hi all. Was wondering if there was any thought to allowing functions to be passed without having to generate an intermediate lambda.
19:49
<
Adrianh >
Seems to be wasteful.
19:51
<
Adrianh >
And generally annoying. 😉
19:52
<
Adrianh >
Esp if you are just making a pass through lambda.
20:02
Adrianh62 has joined #openscad
20:04
Adrianh has quit [Ping timeout: 250 seconds]
20:05
<
Adrianh62 >
Hmmmm. Got kicked. Still Adrianh.
20:05
<
Adrianh62 >
Also, seems I can do this:
20:05
<
Adrianh62 >
function test_true(arr, data, i) = !!arr[i];
20:05
<
Adrianh62 >
function find(arr, data=undef, fn=function (arr, data, i) test_true(arr, data, i), i=0) =
20:05
<
Adrianh62 >
i < len(arr)
20:05
<
Adrianh62 >
? fn(arr, data, i)
20:05
<
Adrianh62 >
: find(arr, data, fn, i+1)
20:05
<
Adrianh62 >
: undef;
20:05
<
Adrianh62 >
echo("Test find:", find([0,0,[],3,0])); // result 3 ([] is falsy)
20:05
<
Adrianh62 >
But can't do this:
20:05
<
Adrianh62 >
function test_true(arr, data, i) = !!arr[i];
20:05
<
Adrianh62 >
function any(arr, data=undef, fn=function (arr, data, i) test_true(arr, data, i), i=0) =
20:05
<
Adrianh62 >
i < len(arr)
20:05
<
Adrianh62 >
? fn(arr, data, i) || any(arr, fn, data, i+1) // WARNING: Ignoring unknown function 'fn'
20:09
<
Adrianh62 >
Even tried:
20:09
<
Adrianh62 >
function any(arr, data=undef, fn=function (arr, data, i) test_true(arr, data, i), i=0) =
20:09
<
Adrianh62 >
i < len(arr)
20:09
<
Adrianh62 >
? fn(arr, data, i) // WARNING: Ignoring unknown function 'fn'
20:09
<
Adrianh62 >
: any(arr, fn, data, i+1)
20:09
<
Adrianh62 >
: false;
20:09
<
Adrianh62 >
Which is basically the same as find() but still didn't work.
20:14
J25K63 has quit [Quit: Client closed]
20:14
J25K63 has joined #openscad
20:15
<
Adrianh62 >
Oh, my goof. I forgot that I changed the parameter order in the sig. Works now. Anyway, is there a reason for having to put in an intermediate lambda to hoist the function name into the variable namespace? Why are function names and variable names in different namespaces?
20:15
<
Adrianh62 >
If it really is necessary, could we have a helper that automagically do the hoisting for us?
20:24
<
Adrianh62 >
So many ppl here but no one knows anything?
20:47
Adrianh62 has quit [Ping timeout: 250 seconds]
21:49
teepee_ has joined #openscad
21:52
teepee has quit [Ping timeout: 272 seconds]
21:52
teepee_ is now known as teepee
21:58
Adrianh has joined #openscad
22:01
Smeef has joined #openscad
22:03
Adrianh is now known as AdrianH
22:26
Ckat has quit [Ping timeout: 258 seconds]
22:27
Ckat has joined #openscad
22:28
hyperair has quit [Ping timeout: 258 seconds]
22:28
jbd has quit [Ping timeout: 258 seconds]
22:28
oldlaptop has quit [Ping timeout: 258 seconds]
22:28
jbd has joined #openscad
22:28
oldlaptop has joined #openscad
22:29
hyperair has joined #openscad
22:44
JordanBrown has joined #openscad
22:45
<
JordanBrown >
AdrianH: Why are function names and variable names in different namespaces? The original answer doesn't really matter; the answer now is "because they are, and changing it would break existing programs".
22:47
<
JordanBrown >
It isn't possible to write an OpenSCAD-language helper that will automatically "hoist", because there's no way to pass around an arbitrary list of parameters.
22:48
<
JordanBrown >
But you could always define the function using a lambda in the first place, "test_true = function () ...;"
22:53
AdrianH has quit [Quit: Client closed]
23:38
JordanBrown has quit [Quit: Leaving]
23:59
rogeliodh has quit [Server closed connection]