libera/#lisp - IRC Chatlog
Search
18:09:35
White_Flame
when each one finishes, decrement the counter (presumign this is all single-threaded python) and when it hits zero, then you continue on
18:11:40
White_Flame
doesn't matter if #2 and #3 finish first, while you're waiting for #1 to finish
18:12:11
rendar
and i guess i want to be woken up when a single pid completes, e.g. if its waiting a.com, but it completed get-name server, i can call get with that url got by server
18:13:18
rendar
basically, if i have `(store (get a.com) (get b.com))` i can call store when a.com completes, and then recalling it when b.com completes
18:55:55
sham1
I'd say that the more Lisp-y alternative would be to have an async LET, so that you'd do (async-let ((a-result (get a.com)) (b-result (get b.com)) (store a-result b-result)). In this case the async-let can make sure that the expressions are fired at the same time, and that the store is only executed once both have completed
18:59:29
sham1
For example, if one was to make this toy lisp on-top of Javascript instead, one could, in the implementation, `await` a Promise.all call of an array of all the initializing expressions, and then after that execute the body, binding whatever results the async operations provide. I assume Python has the same ability and so a toy lisp on that could do that too
19:49:10
lisbeths
I think that when you write in this prefix notation: define factorial lambda x if eq x 1 1 + 1 factorial - x 1
19:50:09
lisbeths
it is just with reverse polish notation that you handle the stack manually instead if allowing the language to parse the abstract syntax tree for you
19:51:23
White_Flame
in an interpreter, the "stack" is the nested (get-next-value) calls to consume the next fixed number of input terms
21:21:23
rendar
White_Flame, well, i have to save that '+' when i try to get results of get-next-value, calling eval and/or apply recursively, basically is just a stack
21:43:29
White_Flame
rendar: that (+ (get-next-value) ..) was for lisbeths's fpn code, not for your async examples