<paroneayea>a bunch more people shared that post today, even though I posted it a couple of weeks ago :) <ijp>I'm pretty annoyed, I have one particular line that works from the repl just fine, but fails for nonobvious reasons in a script <janneke>paroneayea: wow, 10 shares. You did write a great post :-) <janneke>paroneayea: in the mean time, tcc.mes now only runs and segfaults <janneke>it has just compiled `int main (){return 42;} to a valid ELF .o file <reepca>"ERROR: In procedure ttyname: Success"... what? <manumanumanu>so, if I have a macro and I pass a lambda exression to it, can I in any way call that lambda in the macro? I can of course using eval, but that's no fun <random-nick>manumanumanu: as in evaluate in macro expansion time? I think that eval is the only way <ennoausberlin>I am looking for a function which does something similiar to Smalltalks collect: message. Say, I have a collection/list with single distances. How can you create a collection that sums up the single distances. I guess I can do it recursivly but I read about map and fold are equivalent to Smalltalks collect: and inject: messages <atheia>(reverse (fold (lambda (in return) (cons (+ in (car return) return))) '() '(3 4 9 2))) <atheia>(i might be missing some parens, did this on the fly in my irc client…) <ennoausberlin>Well, thats not easy to understand. Is there a more concise way? But I turns me into the right direction <atheia>There might be, for me it's pretty intuitive, but then I'm used to fold now. Happy to explain parts if that helps. <ennoausberlin>Thank you. I am still a newbie who wants to know how to do it the scheme way. I am living on the countryside so no mentor around. You are of great help <atheia>But other than that, not aware of a more concise way. <atheia>(use-modules (srfi srfi-1)) (reverse (fold (lambda (in return) (cons (+ in (car return)) return)) '(0) '(3 4 9 2))) <atheia>(there were two small errors in the original suggestion. <ennoausberlin>I wrote a function that searches for a pattern in text. Because I want to split the text into pieces. string->contains gives me an index for a single first match. I did it recursivly so I get relative indices. Thats the reason I want to sum up. Converting relative to absolute indices <ijp>the function is usually called scanl, but is not a common one in schemes <ennoausberlin>ljp: Thank you for the pointer. My lunch break is over. I will try it out later <ijp>I am not sure why read-and-compile is giving me errors when compile-file is not <ijp>hmm, but not at the repl <ijp>ice-9/boot-9.scm:230:17: In procedure map1: ice-9/boot-9.scm:230:17: Syntax error:(map1 (() ((_) #t) ((_ x) x) ((_ x . y) (if x (and . y) #f)))) ***Amynka is now known as Zelena
***Zelena is now known as Richmond
<ijp>I do not understand why this error sometimes occurs and sometimes doesn't <ArneBab>ijp: do you have an update to your js work at hand? <ArneBab>(or rather: can I help you somehow to get that update out?) <ijp>ArneBab: the email is written, I just want to get this one thing fixed before I send it <ijp>wingo: are you around? I was wondering if you know why I might be getting the above error <ijp>I'm really confused because guild compile works, compile-file & read-compile work in a different script, but in another they are failing <wingo>am around but a bit spotty; lost my laptop and am currently rotating all the keys :P <ijp>I've pulled this out of my (scripts jslink) module <ijp>can you think of any implicit state I'm depending on <ijp>okay, there only seems to be a problem when I call link-dependency on two files, not just one <wingo>ijp: do you have an example that's not boot-9? <wingo>boot-9 is strange as you know <ijp>wingo: I think the actual file is a red herring now <ijp>is that default environment preserved between calls? <ijp>hmm, no that shouldn't be it <ijp>wingo: so I tried using it on psyntax then ice-9/deprecated, and got a different error, but not when psyntax followed by psyntax <ijp>I think maybe psyntax is the problem <ijp>okay, a workaround seems to be to leave psyntax to last, but I don't know why that works <ijp>my feeling is that state is being leaked, but I don't know if it's me or guile, and if it is guile then why has it not been noticed before now? <cmaloney-exile>I'm used to debuggers like gdb and pdb. Is there something similar where I can single-step through guile's code? (eg. set a breakpoint on a function and single-step through it?) <ijp>there is a debugger builtin <cmaloney-exile>trying ,break function-name doesn't seem to do what I thought it should. :) <ijp>a mistake a day keeps the ego away <cmaloney-exile>pretty sure I've made enough mistakes to send my ego on a very nice trip via frequent-flyer miles <ArneBab>ijp: does "no cheney on the mta" mean no tail recursion? <ArneBab>ijp: if I understood your answer correctly, we can already execute the compiled file in node. And that’s great! <ArneBab>ijp: regarding cheney on the mta: I think relying on tail calls in the JS implementation is a perfectly good solution. <ArneBab>ijp: given that WebAssembly will support proper tail calls, I think it is very likely that proper tail calls will soon be provided in most JS implementations. <ijp>ArneBab: yes, Cheney on the MTA is the method Chicken uses for providing proper tail call recursion with C <amz3`>cmaloney: pdb doesn't exist in guile yet <paroneayea>there seems to be some sort of memory leak, either in 8sync or in Fibers still... gotta track it down <paroneayea>If I have two actors polling each other constantly I seem to end up in some sort of memory leak problem. Not sure why that is yet. <paroneayea>what's a good way to track down whether a procedure is properly tail recursive in guile?