<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? <kdkeie>I won you guile game got to level 100 and killed the evil wizard <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>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>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 <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>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>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>scheme@(guile-user)> (define (w x) (format #t "~v:@y~%" 20 x) (if #f #f)) <stis>scheme@(guile-user)> (w (iota 100)) <stis>some extra typing but not too bad in my view <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>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)) ***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>it seems that the REPL options are not easy to find in the manual. they are discoverable from the REPL ",help" but not easily. <mark_weaver>sneek: later tell please_help: you can customize the REPL printer like this: <mark_weaver>sneek: later tell please_help (define (my-printer repl val) (truncated-print val #:width 1000)) <mark_weaver>sneek: later tell please_help and then: ,option print my-printer <mark_weaver>sneek: later tell please_help truncated-print is in (ice-9 pretty-print) <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>please_help: actually, the repl printer is expected to print a newline, so: (define (my-printer repl val) (truncated-print val #:width 1000) (newline)) <paroneayea>I've got an atom -> activitystreams 2.0 translator written in guile