IRC channel logs
2023-01-30.log
back to list of logs
<old>Does the GC scan pointers created with make-c-struct, which may contain pointer of Scheme objecT? <old>For example: (let ((foo (make-foo))) (make-c-struct (list '*) (list (scm->pointer foo)))) <daviid>old: you need to keep a 'hard' ref to the result of make-c-struct calls, unles they'd be gc'ed <daviid>*unless/otherwise they'd be gc'ed <old>yes but is keeping only a reference to pointer of the c-struct enough? <old>In other words, is `foo' protected if I only keep the result here? <old>Right now I do keep a reference of `foo' somewhere <old>But it seems like a duplication of data :-/ <daviid>i am not entirely sure - do you have some code that shows you need to ? <daviid>try to release the foo hard ref and call the gc - <old>I'm not sure either. It's a tricky part since `foo' is actually a callback in an event loop in C <old>I prefer to be on the safe side here and keep a hard reference to it to avoid any segmentation fault <daviid>old: we hould be able to try imple things in the repl <old>a simple example should suffice here <old>oh well I do get `foo' in a guardian even though a pointer of it is store in a C struct <old>that answer my question then. I need a hard reference <daviid>old: yes, same here, i tested as well - <abrenon>I've found a link in the documentation pointing to a google site asking for some authentification <civodul>abrenon: hi! that's surprising indeed <abrenon>I was trying to learn the syntax for function composition in guile (because since '.' is taken for cons, I have no idea what could be used for composition) <BitPuffin>trying to build an epub version of guile manual for my ebook reader but can't get my guix version of texi2any get it to understand that I did in fact install perl-archive-zip <civodul>BitPuffin: does it work if you do "guix shell texinfo -- texi2any ..."? <abrenon>thanks again ! But I haven't found anything regarding function composition in the document (or it's called something else) <abrenon>maybe it's not idiomatic to express things in terms of composition in guile ? <BitPuffin>guix shell texinfo perl-archive-zip -- texi2any --epub3 guile.texi <BitPuffin>it just says texi2any: Archive::Zip is required for EPUB file output <BitPuffin>to be fair this problem is probably more fore #guix <BitPuffin>but it would be nice to have guile manual in epub! <civodul>BitPuffin: oh, this appears to work: guix shell texinfo perl perl-archive-zip -- texi2any --epub3 guile.texi <civodul>but really, it's an omission in the 'texinfo' package in Guix <BitPuffin>hmm no actually it probably makes sense with how guix works <BitPuffin>since the environment variables for search paths are in the perl package rather than the perl dependencies <BitPuffin>but hmm I guess you're right though that texinfo package should also define those search paths <BitPuffin>not sure if I just pass it guile.texi to build the epub correctly though haha <BitPuffin>oh the pdf for guile seems to be built with docbook rather than texinfo <BitPuffin>has anyone tried to get the nanopass framework working in guile? <old>sneek now detects joined? <count3rmeasure>perhaps a silly question but... If I wanted to calculate directly in hex, and get the return value in hex, what is the best way to do that, if its possible? Am I going to have to convert to integers first? <old>What do you by retrun value in hex? <old>There's a hex reader for number, e.g #xaf <old>But the `return' value is a number <old>If you want a reprensetation in hexadecimal: (number->string x 16) <count3rmeasure>right, I mean if I'm subtracting to hex numbers then I get back a hex number, wanted to try it without having to do conversions <count3rmeasure>and by asking I just realized I'm going to have to do a conversion anyway from a string in hex, so I guess it doesn't matter, but I'm still curious <old>your example return 0 btw <old>and it would be #x7ffff7f52000 <old>to have a number directly <old>If you want to create a number from a string "0x7ffff7f5200" you need to remove the `0x' prefix and passe the result to `(string->number <> 16)' <old>so you need string->number and number->string <lloda>numbers are numbers. hex is just the representation, so 'hex number' is always a string <count3rmeasure>but if the representation is consistent across the the data structures that consume these numbers I would prefer to keep it in hex, especially since its easier to read and reason from when I need to debug <dsmith-work>Numbers inside modern machines are *always* binary. In ages past there was also decimal. BCD (Binary Coded Decmial) actually. <old>BCD still exists in some embedded system no? <old>For some very specific problematic. I can't remember what <old>Oh I think it was bank or something. Did not want to lose any cent! Something like that <mwette>BCD may exist in hand calculators - it was used in early (at least) HP's <dsmith-work>BCD was popular on mainframes (like IBM System/360 and successors) becuse Money. <dsmith-work>Maybe still is? I've been away from that for about 40 years. <old>I also remember the CORDIC algorithm <old>somehow it was related to BCD <old>Right Wikipedia says that CORDIC was used on pocket calculator that were using BCD <dsmith-work>A friend of mine sometimes mentions base 1 numbers. I just can't wrap my head around that. <dsmith-work>A long time ago I was working in Forth, and was printing out BASE. <dsmith-work>Took the longest time to figure out why it was *always* 10, even though I set it to 16, 8, 2 whatever.. <sneek>I've been running for 27 days <sneek>This system has been up 13 weeks, 5 days, 17 hours, 9 minutes <rendar>guile runs some scheme interpreter? <old>Base 1 numbers would mean that you could encode 1^N numbers with N cells <old>In other word, you can only encode 1! <old>I can't even think of a physical way of encoding a base 1 <old>sneek: apropos string->number <sneek>(guile): string->number #<procedure string->number (_ #:optional _)> <old>sneek: what is base 1 number?