IRC channel logs
2017-01-24.log
back to list of logs
<sneek>Someone once said sneek is a good boy <daviid>sneek: later tell spk121 I'm sorry my internet connection abruptly ceased to work, then I had to leave ... but again thanks for your help! <sneek>Welcome back spk121, you have 1 message. <sneek>spk121, daviid says: I'm sorry my internet connection abruptly ceased to work, then I had to leave ... but again thanks for your help! <davexunit>civodul: you're welcome. sorry for the long delay. <ManDay>I can't find "div" nor "mod" in guile - how is that possible? <davexunit>'div' and 'mod' are both procedures in (rnrs base (6)), though <ManDay>yes they are and there isn't mention of a function "modulo" (what is the correspoding div called anyway). why are they not in guile? <ManDay>davexunit: r6rs specifies "div" and "mod" <davexunit>because that's the procedure that guile has provided for a long time. <ManDay>i was under the impression that the "default environment" were to be r6rs <ManDay>so i assume its common practice to load r6rs in the .guile file? <davexunit>I haven't heard of anyone doing that but it sounds convenient if you always want an R6RS environment. <ManDay>why would anyone not want an r6rs environment? Would anyone intend to *not* program according to the spec? <davexunit>ManDay: there are many scheme specifications <ManDay>i didn't realize that either. i that r6rs was *the* scheme spec <davexunit>it is the 6th edition of the Scheme standard <davexunit>and to make it more confusing, there's both r7rs-small, and r7rs-large <ManDay>so I should not assume this works like for C or c++ or something like that? <ManDay>where the interpreter/compiler always tries to abide to the current spec <davexunit>guile modules written in r5rs can coexist with modules written in r6rs, for example <ManDay>so which scheme spec is the commonly used one if it's not r*rs ? <davexunit>so, Scheme has standards, but every Scheme implementation is actually a new language in its own right. <davexunit>Guile includes tons of features that aren't in any Scheme standard. <davexunit>so, I write Guile Scheme programs, not Scheme programs. <davexunit>R5RS is widely supported amongst Scheme implementations, with R6RS and R7RS less so. <ManDay>ok, but that sounds much like one would say "I write C programs for GCC, not according to the C standard" and that isn't necessarily a good thing <ManDay>At least in C I only use nonstandard feature only when absolutely necessary (and that has probably happend 2, 3 times in a lot of years and mostly concerned build-specific) <ManDay>So I guess by that attitude I should stick to r*rs then? <ManDay>But every scheme implementation eventually wants to support the maximal r*rs, right? <ManDay>and when you say "tons of features" these are forms then and not new syntax that would interfer with r*rs libraries being loaded, right? <davexunit>ManDay: the features I'm talking about are things that will work in Guile only <davexunit>try to run them in Chicken and it won't work <davexunit>you won't be able to do much using only standard Scheme <ManDay>davexunit: Yes but will they interfer if you are writing according to r*rs? <ManDay>How am I not able to do much using say r6rs? <davexunit>ManDay: the scheme specifications leave out many things that would be necessary for complex programs <ManDay>can you give an example please so i can follow? <davexunit>I don't know if r6rs or r7rs have anything to say about sockets, also. <davexunit>the point I'm trying to make is that Scheme is unlike C/C++ <davexunit>there are standards, and some libraries are written to be portable using them, but there are a great many things that cannot be written in portable Scheme. <davexunit>so from a practical viewpoint, I think it's best to view each Scheme implementation as its own unique language. <davexunit>in addition to standards, you can check out the "Scheme Requests for Implementation" documents, or SRFIs for short. <davexunit>a bunch of things are specified there that, while not necessarily a part of any Scheme standard, are implemented by nearly every Scheme out there. <ManDay>still, i assume these features are provided in a manner that does not interfere (i.e. they are invisible unless you know they are there)? <davexunit>correct. if you don't make use of them, they don't do anything. <avoine>ACTION is having fun debugging a race in fibers <paroneayea>hm, I have a case where I have a class-level cache in GOOPS <ManDay>I wonder about how Guile's scheme is actually such that it's invisble unless used. <ManDay>Doesn't a define-syntax remain in effect and possibly affects the interpretation of other forms? <davexunit>so people put in effort to make sure such things don't happen. <paroneayea>there was an above conversation I missed, ignore me <ManDay>davexunit: but take for example (define-class) which is a transformation. If I were not to know about (define-class) and assume it doesn't exist and tried to define (define define-class (lambda ... ...))) wouldn't that interfere? <ManDay>paroneayea: sorry, should have mentioned <davexunit>first, define-class is in the (oop goops) module, you'd have to import it to get it. <ManDay>I thought the syntax transformations take precedence over forms <ManDay>davexunit: ah okay. yet, is there a second reason? <davexunit>second, you can make your own syntax with that name and shadow any previous definitoin. <ManDay>davexunit: yes, but what if I were to define a form instead of define-syntax? <ManDay>that woulnd't shadow the (define-syntax) <ManDay>davexunit: a (define define-class (lambda (x) ...)) for example <davexunit>which you wouldn't do if you were writing a program restricted to a particular scheme standard. <ManDay>davexunit: okay, but you agree that if it were imported by default then it would invisibly interfer due to its "unexpected" (define-syntax), righ? <davexunit>ManDay: remember what I said about guile being designed in a compatible way? <ManDay>I'm just saying speculatively *if* it goops were loaded by default <davexunit>you just shadowed the macro named 'foo' with the procedure named 'foo' <ManDay>hm okay, i see. I was under the impression the procedure doesn't shadow the macro. sorry, beginner mistake <spk12>shadowing is fun: (define (func x) (let ((define x)) define)) <ManDay>What does it mean if ",locals" gives, in two lines: $6 = stage = (1 . 1) and stage = #<unspecified> ? <ManDay>(I get an error one stacklevel down on (cdr stage) saying that "stage" is not the correct type) <ManDay>also I'm not sure how to examing variables on the stack. when I just give their name on the prompt (while in the frame where they are defined) I get an error about them not being defined <lloda`>you can use the $1 or $2 or whatever to refer to the variable (the leftmost column in the ,locals output) <paroneayea>they use (record-type/method-name) as a convention in some places <ManDay>lloda`: thanks, but what does it mean that stage is mentioned twice, once with and once without the $ ? <davexunit>doesn't look like much I guess but now I have my own fast font renderer and don't need to rely on SDL_ttf which was always a hack anyway. <janneke>davexunit: chickadee says `guix install -f guix' <janneke>i also type that sometimes -- even tried it to see if it works ;-) <paroneayea>davexunit: oh! You have your own font renderer? :O <paroneayea>you wrote your own font renderer from scratch????! <davexunit>basically I only render bitmap fonts, no loading .ttfs with freetype or whatever. <davexunit>another tool can generate a bitmap from a ttf that I can load. <davexunit>ttfs can be rendered and scaled arbitrarily by rasterizing them as "signed distance field" images, which is mumbo jumbo for an image that contains some special information that allows you to render it at any scale (within reason) with nice results <spk12>davexunit: I've written a couple of BDF parsers over the years to use the old X11 fixed fonts as game console bitmap font sets. Kinda fun. <davexunit>spk12: I looked into bdf but decided not to use that format <ManDay>Can someone have a look at this please: https://paste.pound-python.org/show/c37qvNUkkSQmfvWMdm9G/ - I can't figure out how to debug this. When the program breaks, neither ,bt nor ,up and ,locals will reveal why "stage" is not a good argument to (cdr). I will check the channel logs tomorrow in case you happen to reply and I'm gone. <ManDay>(on a side remark, I haven't quite figured out how to distinguish between variables in a higher stack frame and variables which are lexically bound in the context of a function through ,locals) <daviid>spk12: I lefte a chabot message for you under that acronym, yesterday... <spk12>daviid: mistyped and too lazy to fix it. <spk12>daviid: saw it. No prob, happy to help. <daviid>paroneayea: class-redefinition is not called here either, prob a bug... <daviid>i find out class-slot-ref does not call slot-missing has it should: <daviid>scheme@(guile-user)> (class-slot-ref (class-of k) 'hashy) <daviid>oop/goops.scm:2477:18: In procedure class-slot-ref: <daviid>oop/goops.scm:2477:18: In procedure struct-ref: Wrong type argument in position 1 (expecting struct): #f <daviid>instead of scheme@(guile-user)> (slot-ref k 'hashy) <daviid>ERROR: No slot with name `hashy' in object #<<klassy> 55a78ee18aa0> <avoine>not really sure why but guile's pretty-print is not working with my gdb, for example: <avoine>#0 scm_atomic_compare_and_swap_scm (loc=0x5555557b9418, expected=0x7ffff18faba0, desired=0x304) at ../libguile/atomics-internal.h:72 <avoine>(gdb) info auto-load guile-scripts <avoine>Yes /usr/local/lib/libguile-2.2.so.0.0.0-gdb.scm <spk12>ManDay: in line 27 of your code, stage is set to unspecified because your "(if trailing ..." has no alternate. it is an (if <test> <consequent>) not a (if <test> <consequent> <alternate>) <spk12>ManDay: and 'trailing' is #f <avoine>found it, gdb is using guile 2.0... <avoine>hum, gdb don't compile with guile 2.1.5 : ./guile/scm-ports.c:139:45: error: ?scm_new_port_table_entry? was not declared in this scope <spk12>avoine: it was completely removed from master a few months ago. The commit log says "(scm_new_port_table_entry): Remove; not useful". haha