IRC channel logs


back to list of logs

***catonano_ is now known as catonano
***sputny1 is now known as sputny
<manumanumanu>Ahoy hoy! How are you all?! I must warn you. I am in a crazy good mood! I finally got a linux computer again, which means I am now back on a 4k screen and life is good!
<stis>pythons function argument handling is really advanced
<manumanumanu>in a good way or in a bad way?
<stis>I think it has too many features, makes it slow and hard to interop with guiles conventions (keywords)
<manumanumanu>does it do the whole "apply with hash table"?
<stis>The only thing I do not implement is / and * separators, I parse them though
<manumanumanu>but does python do that? it seems like a bad idea...
<stis>keywords are slooow, mainly because I need to interoperate with guile's conventions
<stis>so lot's of flattening hashes to lists like (#:keyw1 'adsds' #:keyw2 1234 ...) and likewise constructing them and in the process translate keyword types back and fourth to strings
<stis>*a **a is supported
<stis>just a single * and a single / is not suprted (yet)
<stis>I also have a macro so that you can have the python convention in scheme if you like
<stis>it looks like e.g. (def (f *li **keyw) ...)
<stis>it looks like e.g. (def (f (* li) (** keyw)) ...)
<stis>and you have (= a b) possibilitis as well to implement normal keywords
<manumanumanu>if it is any consolation, procedure calls are slow in regular python as well
<stis>yeah hole of python is a set! mess with unesesary designs decitions that makes it sloooooow
<stis>so functional programming is a fake there, mutating is in the design.
<stis>I mean you have no hope in using delimited continuation that you reinstate more then one time
<manumanumanu>My friends usually become angry when I categorize python as a language in the "mutability-first" category
<manumanumanu>guh. apple apparently killed target display mode, which has made my inherited imac 2015 a very expensive and fragile paper weight.
<dsmith-work>Morning Greetings, Guilers
<mwette>Does anyone know of a string-diff function, analygous to "diff" for text files, in either Scheme or C?
<stis>I think there is a diff in the python-on-guile, not sure if it works.
<mwette>thanks -- will look
<mwette>SequenceMatcher in python difflib
<chrislck>guile should have a style guide similar to
<jcowan>How does Guile support #n= and #n# lexical syntax? Does it insert markers for #n# and patch them up, or does it process them forward somehow?
<wklew>chrislck: there is this one, often mentioned
<manumanumanu>chrislck: Ḯ have been writing a little text on how to write fast idiomatic scheme (and why python programmers always tend to write the slowest scheme)
<manumanumanu>and it has some style advice
<manumanumanu>which is very similar to the one you linked, but with a "pattern matching for clarity"
<manumanumanu>i have been meaning to publish it soon. I will make sure to ping you when I do
<manumanumanu>and if I ever finish my optimizing pattern matcher, the current _marginal_ downside of match compared to hand tuning your cond code will be nil.
<roelj>So, I execute a command using open-input-pipe and I capture both stderr and stdout (by using with-error-to-port). If the command was succesful, output is written to stdout, but if something goes wrong, output is written to stderr. How can I properly test whether the command ran succesfully?
<roelj>I think the test would be something along the lines of "if something was written to stderr, return #f".
<roelj>Would “(eof-object? (lookahead-char stdout-port))” block?
<dsmith-work>Command success and stuff written to stderr are independent.
<dsmith-work>Lots of things write to stderr to not pollute stdout.
<dsmith-work>Well, maybe not "lots".
<roelj>dsmith-work: Yes, I am aware. But I am certain this command will only write to stderr if something goes wrong ;)
<roelj>It's a very very special case
<roelj>And in this case the exit code in both cases is 0..
<roelj>Yeah, I know
<manumanumanu>roelj: isn't there a char-ready?
<roelj>manumanumanu: Hah! There is!
<roelj>manumanumanu: Thanks!
<manumanumanu>good old "venerable port interfaces"
<manumanumanu>you will need to double check that it isn't the eof object though
<manumanumanu>as that also satisfies the predicate
<manumanumanu>roelj: ^
<roelj>manumanumanu: Thanks, I was reading the manual :)
<dsmith-work>roelj: I'm curious what you come up with.
<roelj>dsmith-work: I've run into some problem, but currently I have: (and (char-ready? port) (not (port-eof? port)))
<roelj>I'm sure I have something working at some point tomorrow.
<manumanumanu>Wow... I am playing around with syntax-local-binding. great scott. fun times!
<manumanumanu>who would have thunk it, that little me could have so much fun with module reflection. I can now, at compile time, tell whether something is a pattern matcher or not as long as it is in another module.
<leoprikler>great, let's use that for pattern matching
<leoprikler>(cond ((pattern-matcher? code) ...))