IRC channel logs

2015-05-24.log

back to list of logs

<zacts>woah! cool paroneayea
*zacts bookmarks
<paroneayea>speaking of woah
<paroneayea>sxml-match is the shit
<paroneayea>hello
<paroneayea>so, with the sxml matcher, it seems like attribute ordering doesn't matter, but generally, element order does
<paroneayea>is there any way to get around element order mattering so much?
<paroneayea>oic
<paroneayea>named catamorphisms is the way to go
<zacts>yo
<kdkeie>I won
<kdkeie>I won you guile game got to level 100 and killed the evil wizard
<stis>Hi folks!
<civodul>Hello Guilers!
<stis>Hi civodul:
<Tirifto>Hello!
<please_help>There is no way to set the destructor for a record (as in (srfi srfi-9 gnu)'s set-record-printer! for printer), nor for a goops object?
<please_help>and no way to add a hook for arbitrary objects?
<please_help>is the only way to do that to use the ffi to bind guile.h since the c api actually supports doing that?
<bipt>please_help, guile has guardians, described in (info "(guile)Guardians"). i think that's the only scheme-level finalization interface
<please_help>bipt: guardians weren't enough, but I've just learned there's a add-hook! and after-gc-hook that can be used in conjunction with guardians to do what I want
<please_help>thanks
<please_help>is there a way to make sure guile doesn't try to display an object with a large representation for several minutes and then crash?
<please_help>like force guile to only display the first K characters of a representation?
*stis is listening to good good music and frantically hacking scheme, prolog C
<stis>please_help: can't you write a custom printer for a struct or a class?
<stis>there shuld exist helper function for limiting th output in the guile-log sources
<stis>it is used in the dubugger, maybe looking at those sources will give a hint.
<please_help>stis: the problem is existing constructs. Say I have a dozen million elements in an array as a result of a mat-mul, then I don't want my forgetting to (define result ...) causing guile to crash and burn
<please_help>I'll check if I can find these helper functions
<stis>i'm looking at system repl debug.scm
<stis>print-frame is a good suspect theirin
<stis>looks like a format feature to me
<stis>please_help: http://www.gnu.org/software/guile/manual/html_node/Formatted-Output.html#index-format
<stis>~y
<stis>Structured printing. Parameters: width.
<stis>Look that up. That will do the trick for you I hope.
<please_help>But the default printer (the one from the repl) cannot be substituted, can it?
<stis>no it looks to be a feature of the format procedure that they take advantage of, see the link
<stis> (format "~v:@y~%" 10 (iota 100))
<stis>scheme@(guile-user) [1]> (format #f "~v:@y~%" 10 (iota 100))
<stis>$5 = "(0 1 2 …)\\n"
<stis>scheme@(guile-user) [1]> (format #f "~v:@y~%" 20 (iota 100))
<stis>$6 = "(0 1 2 3 4 5 6 7 …)\\n"
<please_help>but how is that useful when the repl's printer doesn't use format, and even if it did, it doesn't seem the format call's parameters can be changed?
<stis>oh, it's a repl thingie, wrap thhe output then
<stis>(define (w x) (format #f "~v:@y~%" 20 x))
<stis>scheme@(guile-user) [1]> (w (iota 100))
<stis>$7 = "(0 1 2 3 4 5 6 7 …)\\n"
<stis>or better,
<stis>scheme@(guile-user)> (define (w x) (format #t "~v:@y~%" 20 x) (if #f #f))
<stis>scheme@(guile-user)> (w (iota 100))
<stis>(0 1 2 3 4 5 6 7 …)
<stis>scheme@(guile-user)>
<stis>some extra typing but not too bad in my view
<stis>please_help: ^^
<stis>I fyou wan you can define a language of your own and mod the printer, just copy the scheme langugae spec.scm file, but add a slightly modified printer and off you go
<stis>,L my-schme
<stis>my-scheme> (iota 100)
<stis> (0 1 2 3 4 5 6 7 …)
<stis>you can define a few globals that controls the output and have them in the repl environment via the guile startup file
<mark_weaver>please_help: you can customize the REPL printer like this:
<mark_weaver>(define (my-printer repl val) (truncated-print val #:width 1000))
<mark_weaver>,option print my-printer
<mark_weaver>truncated-print is in (ice-9 pretty-print)
***Guest54801 is now known as Cork
<mark_weaver>the repl code is in module/system/repl/*.scm. see 'repl-print' in common.scm
<stis>yes that's better (just trying to be helpful though)
<mark_weaver>stis: that's fine
<mark_weaver>it seems that the REPL options are not easy to find in the manual. they are discoverable from the REPL ",help" but not easily.
<stis>ok
<mark_weaver>sneek: later tell please_help: you can customize the REPL printer like this:
<sneek>Will do.
<mark_weaver>sneek: later tell please_help (define (my-printer repl val) (truncated-print val #:width 1000))
<sneek>Got it.
<mark_weaver>sneek: later tell please_help and then: ,option print my-printer
<sneek>Will do.
<mark_weaver>sneek: later tell please_help truncated-print is in (ice-9 pretty-print)
<sneek>Got it.
<mark_weaver>sneek: botsnack
<sneek>:)
<please_help>thanks
<sneek>Welcome back please_help, you have 4 messages.
<sneek>please_help, mark_weaver says: you can customize the REPL printer like this:
<sneek>please_help, mark_weaver says: (define (my-printer repl val) (truncated-print val #:width 1000))
<sneek>please_help, mark_weaver says: and then: ,option print my-printer
<sneek>please_help, mark_weaver says: truncated-print is in (ice-9 pretty-print)
<mark_weaver>np!
<mark_weaver>please_help: actually, the repl printer is expected to print a newline, so: (define (my-printer repl val) (truncated-print val #:width 1000) (newline))
<please_help>right
<paroneayea>arg
<paroneayea>being bitten by a locale/unicode issue
<paroneayea>aha
<paroneayea>setting default-port-encoding fixes it
<paroneayea>okay!
<paroneayea>yayyyy
<paroneayea>I've got an atom -> activitystreams 2.0 translator written in guile
<paroneayea>it works!
<zacts>hi
<paroneayea>hi zacts
<zacts>hey