IRC channel logs

2013-06-22.log

back to list of logs

<nalaginrut>morning guilers~
<nalaginrut>fortunately, lua/runtime.scm did a lot of work, that makes the work easier ;-P
***banannagram is now known as bananagram
<nalaginrut>(>= "1" 1) ==> #t Is that accepted?
<nalaginrut>it's exception in Racket
<nalaginrut>well, the same in Chicken
<nalaginrut>I believe it's a bug
<ijp>I get an exception for that
<nalaginrut>guile?
<ijp>if you are using goops and have overriden >= that may give something different, hmmm
<ijp>nalaginrut: of course, this is #guile
<nalaginrut>but (>= "1" "1") throw exceptioin
<ijp>right
<ijp>>= is numeric comparison only
<nalaginrut>strange, now it's normal, I quit REPL and enter again
<nalaginrut>(<= "1" 1) get exception
***ijp is now known as i-jp
***i-jp is now known as ijp
<aidalgol>ijp: The scope of the REPL server is... what? Where it was started?
<ijp>scope how?
<ijp>when you connect, you'll be in (guile-user), just like you would normally at the repl
<nalaginrut>can I use eqv? to check two hash-table ?
<aidalgol>So are all the variables in scope when spawn-server was run are in scope in (guile-user)?
<ijp>aidalgol: it's top level only
<aidalgol>ijp: Meaning...?
<ijp>meaning (let ((a *foo*)) (spawn-server)) is the same as (spawn-server) modulo effects
<aidalgol>ah
<aidalgol>So how do I make the bot accessible to the REPL?
<aidalgol>Bind it in the top-level?
<ijp>right
<ijp>since, you have a main loop, you'll need to spawn the repl server before going into it
<ijp>I have some ideas about how to make an irc bot that supports more complicated interactions than current bots do, but no use case for it :/
<aidalgol>Yeah, I don't have a use for a "party line", (a la eggdrop).
<aidalgol>I knew some script kiddies back in high school who had an IRC services bot, written in PHP, wired up to the authentication system for their network of shell servers.
<aidalgol>They even went so far as to modify libpam.
<ijp>the funny thing is, I was actually inspired by jordigh's lol script
<ijp>and the question: "how can I write this in a sane manner?"
<aidalgol>I think I've found a bug in the configure script (in 2.0.9)
<aidalgol>I didn't have libunistring installed, so I installed it, and ran ./configure -C again, and it still said I didn't have it, but it detects it if I run ./configure again *without* -C
<taylanub>nalaginrut: `eqv?' is trying to be an operational-equivalenc predicate, meaning that it will always give #f when two objects are *not* operationally-equivalent (swapping them can change the program's behavior), but sometimes it might also give #f even though they are operationally-equivalent and it can't detect this (e.g. (lambda (x) x) and (lambda (y) y)). For hash-tables, it should only ever return #t if the two objects are the same
<taylanub>hash-table (so mutating one mutates the other) or if they are somehow immutable and have the same content. We probably don't have immutable hash-tables (do they even make sense?) and the sameness test would be done via pointer-comparison like eq?, so you could just use eq? to be more efficient.
<taylanub>operational-equivalence*
<aidalgol>Who's the build bozo?
<taylanub>aidalgol: -C means "cache" you know. :P
<aidalgol>taylanub: I know.
<aidalgol>Hence the "I *think*"
<taylanub>Oh, OK. I don't know either what it is and isn't supposed to cache.
<aidalgol>I don't *think* it means "also cache failures."
<aidalgol>But I'm not sure.
<aidalgol>Either would make about as much sense with autoconf.
<nalaginrut>taylanub: thanks for explain it ;-P
<nalaginrut>taylanub: my aim is just to compare hash-table/record-type, return #t iif they are point to the same object, but #f when they are not
<taylanub>nalaginrut: For that, eq? is ideal (more efficient than eqv? for testing "object identity" aka "pointer comparison").
<nalaginrut>nice
<ijp>eq? and eqv? are equivalent for objects
<ijp>this "pointer comparison" notion is harmful
<ijp>if you don't know the difference between the two, always use eqv?
<taylanub>Yeah, "pointer comparison" is a very implementation-level notion ...
<taylanub>Pointers in general.
<cky>ijp: I think of the difference between eq? and eqv? to simply mean that chars and numbers can have different identities even when they are numerically the same, and that they're otherwise the same.
<cky>*and that they otherwise behave the same
***banannagram is now known as bananagra
***bananagra is now known as bananagram
<taylanub>My favorite definition is the maximally abstract one, where eqv? is the operational equivalence predicate (but is limited on lambdas because ...), and eq? is just a somewhat broken eqv? which is only allowed to be used on a limited set of data-types.
<taylanub>Then again, one cannot really ignore the implementation details, since those are what inspire and justify the reason for eq?'s existence in first place.
<taylanub>Still, one shouldn't bring the implementation details up to the higher level and give them merit there; after deciding how eq? can best work, it's best to specify it to just work like that on the higher level without trying to make up an abstraction in which it particularly makes sense.
<cky>Well, okay. Describe what eqv? does. Then describe eq? by defining it as similar to eqv? except that in some implementations, it may behave differently for numbers and characters, and in some implementations, eq? may be faster.
<taylanub>Exactly.
<bananagram>does anyone use guile-dbi?
<bananagram>it's not working for me
<bananagram>when I try (use-modules (dbi dbi)) as it says, it returns an errorr
<bananagram>/usr/share/guile/site/dbi/dbi.scm:27:1: In procedure dynamic-link in expression (load-extension "libguile-dbi" "init_dbi"):
<bananagram>/usr/share/guile/site/dbi/dbi.scm:27:1: file: "libguile-dbi", message: "file not found"
<bananagram>ABORT: (misc-error)
<bananagram>but libguile-dbi.* is installed
<fbs>bananagram: if dynamic link fails your probably missing the stuff it tries to 'link' to
<fbs> https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Dynamic-Linking-and-Compiled-Code-Modules.html
<fbs>so youre probably missing some lib called libguile-dbi, check your installation
<bananagram>well, I have /usr/local/lib/libguile-dbi.la, .lai, .a, .so, .so.2, and .so.2.0.4
<bananagram>shouldn't it use one of those?
<fbs>hmm
<bananagram>I fixed it kind of
<bananagram>now it loads libguile-dbi.so and I get access to dbi-*