00:04:10 -!- em [~em@unaffiliated/emma] has quit [Ping timeout: 276 seconds] 00:04:19 em [~em@unaffiliated/emma] has joined #scheme 00:37:17 bitweiler: That is like asking if you should program in C or C++. 00:37:37 bitweiler: The two are totally different languages, and neither is an "obvious upgrade" of the other. 00:37:58 I see 00:41:30 -!- eldragon [~eldragon@84.79.67.254] has quit [Ping timeout: 245 seconds] 00:42:29 kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has joined #scheme 00:43:50 jonrafkind [~jon@jonr5.dsl.xmission.com] has joined #scheme 00:46:06 After the conversation in here earlier, I've decided to bite the bullet and buy my FSF membership :| 00:47:45 -!- kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has quit [Ping timeout: 245 seconds] 00:53:33 -!- hohoho [~hohoho@ntkngw305048.kngw.nt.ftth.ppp.infoweb.ne.jp] has quit [Remote host closed the connection] 00:56:02 *franki^* is now FSF member #9230 00:56:25 -!- mmc [~michal@cs181178061.pp.htv.fi] has quit [Ping timeout: 240 seconds] 00:57:51 \o/ 00:59:05 :-) 00:59:12 I'm so sorry. 00:59:54 Heh, I'm sure that this channel isn't 100% FSF-friendly, but I've got a nice warm feeling inside. 01:00:40 kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has joined #scheme 01:09:13 chandler: Are you sorry that franki^ joined the FSF Associate Membership programme? If so, why? 01:09:14 not FSF-friendly doesn't necessarily mean FSF hostile 01:10:53 cky: I'm not sympathetic to the ideals of the FSF. (I'm not genuinely sorry, if that's what you're asking.) 01:11:29 chandler: That was what I was asking; thank for straightening it up. :-) 01:12:32 -!- kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has quit [Ping timeout: 255 seconds] 01:14:36 mmc [~michal@cs27120227.pp.htv.fi] has joined #scheme 01:30:17 -!- Adamant [~Adamant@unaffiliated/adamant] has quit [Quit: Adamant] 01:41:33 laurus [~laurus@c-68-40-207-109.hsd1.mi.comcast.net] has joined #scheme 01:41:36 -!- laurus [~laurus@c-68-40-207-109.hsd1.mi.comcast.net] has left #scheme 01:44:25 -!- bitweiler [~bitweiler@adsl-99-40-236-82.dsl.stl2mo.sbcglobal.net] has quit [Read error: Connection reset by peer] 01:48:16 -!- franki^ is now known as fds 01:57:17 minsa [minsa@c-24-5-121-157.hsd1.ca.comcast.net] has joined #scheme 02:02:37 -!- masm [~masm@bl15-233-135.dsl.telepac.pt] has quit [Quit: Leaving.] 02:07:49 kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has joined #scheme 02:15:49 -!- Azuvix [~Azuvix@174-27-34-218.bois.qwest.net] has quit [Quit: Leaving] 02:23:44 -!- bgs100 [~ian@unaffiliated/bgs100] has quit [Quit: nighty night] 02:28:40 -!- RageOfThou [~RageOfTho@users-55-112.vinet.ba] has quit [Read error: No route to host] 02:29:03 RageOfThou [~RageOfTho@users-55-112.vinet.ba] has joined #scheme 02:36:36 Adamant [~Adamant@c-68-51-145-83.hsd1.ga.comcast.net] has joined #scheme 02:36:36 -!- Adamant [~Adamant@c-68-51-145-83.hsd1.ga.comcast.net] has quit [Changing host] 02:36:36 Adamant [~Adamant@unaffiliated/adamant] has joined #scheme 02:40:04 -!- dfkjjkfd [~paulh@232-13-ftth.onsnetstudenten.nl] has quit [Quit: Lost terminal] 02:42:54 So. In racket's REPL--after `(require racket)' to get full racket--the expression `(port->string (first (process "echo -E '\\n'")))' returns the expression `"-E \n\n"' 02:44:11 If I run `echo -E '\\n'' in the bash shell on the same machine I get `\\n' (that actual text, no newlines) 02:44:39 gaah 02:44:43 Err, well actually "\\n" is followed by another new line. 02:44:44 too many backslashes 02:44:48 Tell me about it. 02:45:03 vu3rdd [~vu3rdd@nat/cisco/x-ceqfbiuzoqxqhtun] has joined #scheme 02:45:15 (display (port->string (first (process "echo -E '\\n' | od -c")))) 02:45:18 might be illuminating 02:45:24 Compare (string-ref "\\n" 0) with (string-ref "\n" 0). Compare echo -E '\n' with echo -E '\\n' 02:45:53 Also, consider avoiding echo because its behaviour is not portably predictable. 02:46:22 Let me back up then. I'm trying to do some "runtime" testing of a little language I've been writing which compiles to javascript. 02:46:54 (Example: What's wrong with this fragment to echo write the value of the shell variable FOO to standard output followed by a carriage return? echo "${FOO}" | tr '\n' '\r') 02:46:57 So, I have some string that I want to send to the `rhino' JS interpeter. 02:47:00 s/to echo write/to write/1 02:48:22 How would I go about sending an arbitrary string along stdin into a new rhino process? 02:48:41 Hmm.. Actually. 02:49:04 danking: You create a temporary file, then invoke rhino with it. :-P 02:49:21 Don't go through a shell. 02:49:44 Set up argv appropriately and exec rhino. Be aware that rhino may do some argument parsing too, though. 02:50:13 danking: I have an easier option for you. Use a JVM-based Scheme interpreter, then invoke Rhino's classes directly. 02:50:19 danking: node might be slightly easier to use than rhino, more unix friendly if nothing else 02:51:01 cky: Well, I think some of the code I've written relies on Racket specific extensions to Scheme. 02:51:02 Alternatively, find a Scheme implementation that can load the JVM via JNI. I bet you could do it using Racket's FFI, or Chicken, or whatever. 02:51:14 Eh 02:51:17 danking: You can use Racket's FFI to load up the JVM. 02:51:28 However, your JVM will be in-process. 02:51:40 I don't know if that will conflict with Racket's runtime. 02:51:49 *cky* is now itching to find out. 02:51:53 This seems so much more work than I wanted to just send a string to be evaluated to JS.. 02:51:58 Ive been working on something similar -- it was originally written in clojure, but even then I found node easier to use 02:52:15 somnium: Hmm, I hadn't really thought about any other implementations than Rhino 02:52:56 rhino you have to create these context objects and java.class.factory.factory, with node at least its stdin and stdout 02:53:00 cky, `easier'? 02:53:19 danking: I get "\\n\n" as a result. 02:53:36 Is it seriously easier to set up Racket to interface with the JVM, or port all one's code to an entirely new Scheme system, than to set up argv and exec rhino? 02:53:38 besides v8 runs circles around rhino anyway 02:55:35 Riastradh: That depends on how much existing code danking has, I suppose. 02:55:48 Riastradh: But yes, beyond a certain point it's probably not worth it. 02:56:48 eli: That's what I was hoping for... I'm not sure what's up on my end then. 02:57:17 adu [~ajr@pool-173-66-11-168.washdc.fios.verizon.net] has joined #scheme 02:58:11 Riastradh: What do you mean by set up argv and exec rhino? I was going to (process "rhino") and write to the stdin port 02:59:51 danking: You'd seriously be better off writing your code into a temporary file, then passing the location of that file to argv. 02:59:59 danking: Like Riastradh said, `echo' is very unreliable. 03:00:20 danking: I wouldn't be surprised if you get different results in bash because it has a built-in echo version. 03:00:33 Try to use `/bin/echo' or something like that. 03:01:08 But I don't see how that's related to feeding a rhino or whatever process, which you can do like any other subprocess. 03:01:13 *cky* wonders if danking's program will handle code like alert("$(rm -Rf /)") correctly. i.e., without wiping out your hard drive. 03:01:20 I don't know what PROCESS does. If it takes an executable path and an argv and just execs the executable with the given argv, go ahead and use that. If it invokes a shell, I advise you not to use it, and to look for something else. 03:01:36 What Riastradh said (re avoiding anything to do with the shell). 03:02:13 If you like shell-like variable expansion, you can do it safely using wordexp (use Racket's FFI to access that). 03:02:17 Riastradh: (`process' is similar to scsh or something around that neighborhood -- it starts a shell, and `process*' takes a full path.) 03:02:57 s/starts a shell/runs a command through a shell/ 03:04:10 eli, so it is the Racket way to call system; what is the Racket way to call fork and exec with an executable path and argv (and envp)? 03:05:05 Alright. I'll try just writing to a temp file I guess. 03:05:22 (process* "/bin/echo" "-E" "\\n") 03:06:01 Or (subprocess "/bin/echo" "-E" "\\n") which is a lower-level interface. (And returns multiple values.) 03:06:18 danking: Why temp file instead of starting a subprocess and feeding it input? 03:07:08 eli: Seems simpler, playing around in the repl I didn't get what I expected 03:07:21 Didn't get what I expected from subprocess 03:08:07 You start a subprocess, with (racket) threads to deal with the three IOs. 03:08:15 Shouldn't be too difficult. 03:08:35 -!- Riastradh [debian-tor@fsf/member/riastradh] has quit [Ping timeout: 245 seconds] 03:08:46 If you have it installed somewhere in the dept, and you have some interaction that you want to do, I can slap somehing up for you. 03:09:14 -!- xwl_ [~user@nat/nokia/x-helwbfuqsrmldwvw] has quit [Remote host closed the connection] 03:10:00 Riastradh [debian-tor@fsf/member/riastradh] has joined #scheme 03:10:28 danking: One alternative that might not be too difficult is to embed Rhino in some other program that you can pass data to through sockets. This way you'd avoid having to boot the JVM for each invocation. 03:13:24 eli: Sorry for the gist instead of lisp.paste (pastes didn't seem to go through) https://gist.github.com/738605 03:13:28 Isn't rhino some command line thing? 03:13:49 It's an implementation of JavaScript in Java. 03:14:01 I expected `(port->string rhino-stdout)' to give me "2" 03:14:28 -!- mmc [~michal@cs27120227.pp.htv.fi] has quit [Ping timeout: 240 seconds] 03:15:49 eli: Yeah rhino with no arguments gives me a javascript repl 03:16:14 eli: I'm not aware of it being on any dept machines. 03:16:43 chandler: As long as it works as a simple IO repl, there's no reason to go with sockets etc. 03:16:55 danking: The problem in that code is that you don't use threads. 03:17:23 I fear interacting with the world outside Scheme is going to be a real headache. 03:17:45 Not at all. 03:18:00 I have something called `js' on my machine, will that do as a replacement? 03:19:20 eli: I imagine so, though I don't have that here on zerowing 03:19:53 It would seem that js gives me the Rhino repl on my local machine, so that seems fine. 03:21:02 Using rpm, it says that the url of that project is http://www.mozilla.org/js/, and that "This package has been created for purposes of Sablotron ..." 03:21:06 Does this sound right? 03:22:59 eli: I've never heard of Sablotron but Rhino is one of Mozilla's softwares 03:23:24 I think if you can get it working for whatever `js' is I can probably adapt it to my local environment 03:25:18 eli: It struck me from danking's description that completely reinitializing the interpreter would be a fairly frequent operation, which is why I suggested that alternative. 03:26:12 chandler: Indeed it will be frequent. I'm using Rhino to execute JS code I generate. I'm trying to write unit tests for the generated code 03:41:35 danking: ping 03:43:28 -!- adu [~ajr@pool-173-66-11-168.washdc.fios.verizon.net] has quit [Quit: adu] 03:50:11 eli: pong 03:51:23 danking: Try this: cat | rhino 03:51:29 See if you get a repl 03:52:05 eli: yes i d 03:52:12 s/d/do/ 03:52:34 timj_ [~timj@e176192007.adsl.alicedsl.de] has joined #scheme 03:52:35 So that was at least the problem I had. 03:52:48 It turns out that what I'm running is spider monkey. 03:52:57 And it has a `-i' flag to run interactively. 03:53:19 oh 03:53:19 Without that, it just reads the whole input, then runs it when it gets to the end. 03:56:05 -!- timj__ [~timj@e176193093.adsl.alicedsl.de] has quit [Ping timeout: 245 seconds] 03:56:36 danking: So, using a `-i' I was able to do some stuff, but it's tedious because it decides to spit out every expression that I write, which complicates things when you want to distinguish the input from the output. 03:57:01 But anything I do will likely to be different from something that has a different behavior. 03:57:45 So I think that a better bet is either to construct the input completely, then run it and get the whole result, or if you want a repl thing, then it looks like using the js library is easy with the spidermonkey thing, probably with your thing too. 03:57:56 *eli* leaves 03:58:06 Actually, 03:58:12 *eli* shoots and leaves 03:58:28 hmm 03:58:35 What a pain. 03:59:26 Actually^2, 03:59:32 Are you in school tomorrow? 03:59:53 If so you can come to 212 -- we're having a PL party, aka "a final". 04:00:02 So I can show you some stuffs. 04:01:05 eli: I wish 04:01:13 I'm still in California :/ 04:01:21 I love PL parties. 04:01:40 Well, you can bug me more during the day, but email will be much more difficult. 04:01:55 eli: alright 04:01:58 thanks 04:02:02 Otherwise you might catch me later in the week, but then I'll be in a +2 time zone. 04:03:16 eli: Going to Russia? 04:03:32 Or the Ukraine, whatever is over in that part of Europe. 04:04:10 ah 04:04:11 A bit more south than that. 04:04:16 Israel then? 04:04:26 #t 04:04:32 Sweet, enjoy 04:04:49 -!- kilimanjaro [~kilimanja@unaffiliated/kilimanjaro] has quit [Ping timeout: 240 seconds] 04:06:22 asumu [~at@c-71-232-32-44.hsd1.ma.comcast.net] has joined #scheme 04:17:28 -!- saccade [~saccade@209-6-54-113.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com] has quit [Quit: This computer has gone to sleep] 04:21:39 dralston [~dralston@S010600212986cca8.va.shawcable.net] has joined #scheme 04:28:59 lewis1711 [~lewis@222-155-31-117.jetstream.xtra.co.nz] has joined #scheme 04:44:29 parolang [~user@c-64-246-121-114.oregonrd-wifi-1261.amplex.net] has joined #scheme 04:49:26 right, I've RTFM a few times about "let", but I am still not getting how it differs from a nested define 04:49:41 saccade [~saccade@209-6-54-113.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com] has joined #scheme 04:50:49 lewis1711: Internal defines are more like letrec. 04:50:52 lewis1711: a nested define is like letrec 04:50:53 -!- MichaelRaskin [~MichaelRa@195.91.224.225] has quit [Ping timeout: 265 seconds] 04:50:53 ack 04:50:56 somnium: Jinx! 04:51:49 lewis1711: The important distinction between let, let*, and letrec are the scopes involved inside the binding expression. 04:52:20 hmm 04:52:24 well that narrows it down 04:54:28 that reminds me, in an internal define-syntax, exactly what environment is available to the transformer? is it specified anywhere? 04:57:23 (let ((x 2)) (+ x 3)) ;so this expression evaluates to 5, then defines x as 3 04:57:55 lewis1711: No. 04:57:58 defines x as 3? 04:58:01 It returns 5, and x is lost. 04:58:13 (At the end of the "let" form, no bindings survive.) 04:58:32 my bad, that was from a previous definition of x:P 04:58:38 in my REPL 04:58:46 Hahaha. 04:59:11 right, so at the end of let, the binding is lost 04:59:31 I am struggling to see a use of this, I suppose 05:00:12 lewis1711: its sugar for ((lambda (x) (+ x 3)) 2) 05:00:31 oh i see 05:01:16 that narrows it down a bit 05:05:14 (though if you use rackets  it's not really syntactic sugar as it ends up longer;)) 05:05:37 I don't think there's any requirement that "syntactic sugar" make an expression shorter 05:05:59 it's somewhat implied 05:06:01 s/sugar/salt 05:06:13 there's no accounting for taste 05:06:21 very true 05:07:43 My favourite syntactic sugar is named let. 05:07:57 I personally consider it the #1 most useful feature of Scheme, not counting macros. 05:08:15 right, I feel like doing something slightly non-trivial. can you test to see if something is "Expressable"? like um... 05:09:21 (if (expressable x) x ('(x))) 05:10:27 lewis1711: What does "expressable" mean? 05:10:47 well, if i type in (1 2 3), scheme doesn't know wtf to do with that, right? 05:10:52 Do you mean, does not require quoting to eval? 05:10:55 if I type in '(1 2 3), it can express it 05:10:57 yes 05:11:55 Well, simple. Symbols and dotted pairs need quoting. Most everything else don't. (Please feel free to add to the list.) And other things can't be written out and re-read, such as procedures. 05:12:01 (And continuations, promises, etc.) 05:12:46 rudybot: (write +) 05:12:46 cky: ; stdout: "#" 05:12:56 rudybot: (call/cc write) 05:12:56 cky: ; stdout: "#" 05:13:10 lewis1711: ^^--- Those are examples of things that can't be written out in a readable form. 05:13:38 sure, but is there a test at the language level 05:13:46 No. 05:13:52 say you give x to a function, and x isn't defined 05:13:55 ah 05:13:56 You can just use symbol? and pair?. 05:14:41 ah that's what I want 05:14:42 sybol? 05:14:46 *symbol? 05:17:33 aha, and I can use "eval" to unquote 05:18:41 -!- tupi [~david@186.205.37.15] has quit [Quit: Leaving] 05:19:13 MichaelRaskin [~MichaelRa@195.178.216.22] has joined #scheme 05:22:10 xwl_ [~wixu@nat/nokia/x-vuqezpghsalgxmjm] has joined #scheme 05:30:17 -!- tessier_ [~treed@kernel-panic/copilotco] has quit [Remote host closed the connection] 05:33:31 lewis1711: Don't use eval to unquote, seriously. That's just overkill. 05:34:00 cky: why so? 05:34:16 rudybot: (cdr 'foo) 05:34:16 cky: error: cdr: expects argument of type ; given foo 05:34:22 rudybot: (car 'foo) 05:34:22 cky: error: car: expects argument of type ; given foo 05:34:30 Oh, wait. Forgot something. 05:34:44 Okay, I think I get you're trying to do. 05:34:55 rudybot: (cdr ''foo) 05:34:55 cky: ; Value: (foo) 05:35:05 rudybot: (cadr ''foo) 05:35:05 cky: ; Value: foo 05:35:22 That was what I was thinking, that you had a quoted expression and you just wanted to unquote it. 05:35:35 But, like, if you want to actually evaluate it, then yes, eval is fine. 05:35:57 *cky* seriously needs to go to sleep, that's the problem. 05:36:06 indeed I do 05:36:08 :) 05:36:11 :-P 05:36:48 -!- xwl_ [~wixu@nat/nokia/x-vuqezpghsalgxmjm] has quit [Remote host closed the connection] 05:37:07 -!- RageOfThou [~RageOfTho@users-55-112.vinet.ba] has quit [Ping timeout: 240 seconds] 05:37:30 can one test if something is an operator? 05:37:47 (operator? +) => #t 05:37:56 rudybot: (procedure? +) 05:37:56 cky: ; Value: #t 05:38:04 lewis1711: ^^--- 05:38:18 durrr 05:38:21 we had this discussion 05:38:27 there are no operators, everything is a procedure 05:38:31 :-) 05:54:15 ah damn it, how do you get the type of something again? I read it somewhere and can't find it for the life of me 05:55:26 ah that's right. you type it without parantheses 05:55:34 can this be in scheme code? 06:01:11 bleh, i just used (if (not (list? n)) 06:01:11 "Argument must be of type list" 06:11:20 cinch [~cinch@85-127-105-191.dynamic.xdsl-line.inode.at] has joined #scheme 06:17:52 -!- minsa [minsa@c-24-5-121-157.hsd1.ca.comcast.net] has quit [Ping timeout: 240 seconds] 06:22:33 lewis1711: I don't understand the question nor the answer you gave. 06:22:56 lol 06:23:04 then I have done an all-round terrible jobe, really 06:23:22 what I wanted was something like... 06:23:31 (type 3) => Number 06:24:16 lewis1711: What were you trying to do that you would have wanted that for? 06:24:51 wanted to ensure the input to a function was something it could work with 06:27:43 lewis1711: Ah. So you're looking for (number? x) and it's buddies? 06:27:56 not quite 06:27:59 Rmind [~Gmind@113.190.163.233] has joined #scheme 06:28:05 though that's what I ended up with 06:28:08 does the trick 06:28:22 -!- parolang [~user@c-64-246-121-114.oregonrd-wifi-1261.amplex.net] has quit [Read error: Connection reset by peer] 06:28:42 Augh. 06:28:52 wtf would cause racket's READ-STRING to hang? 06:29:01 we may never know 06:29:08 I certainly don't. 06:29:34 another thing i would like is, uh, a function like.... (defined? x) => "no you haven't defined x yet you noob" 06:31:50 ravi [~ravi@118-92-129-45.dsl.dyn.ihug.co.nz] has joined #scheme 06:31:53 -!- ravi is now known as chemuduguntar 06:33:51 cinch- [~cinch@85-127-116-115.dynamic.xdsl-line.inode.at] has joined #scheme 06:34:17 xwl_ [~wixu@nat/nokia/x-ooudkxkafyggcyka] has joined #scheme 06:35:04 -!- cinch [~cinch@85-127-105-191.dynamic.xdsl-line.inode.at] has quit [Ping timeout: 260 seconds] 06:35:45 -!- araujo [~araujo@gentoo/developer/araujo] has quit [Quit: Leaving] 06:38:29 -!- cinch- [~cinch@85-127-116-115.dynamic.xdsl-line.inode.at] has quit [Ping timeout: 264 seconds] 06:41:21 cinch- [~cinch@85-127-111-239.dynamic.xdsl-line.inode.at] has joined #scheme 06:41:30 -!- jewel [~jewel@196-210-134-54.dynamic.isadsl.co.za] has quit [Ping timeout: 245 seconds] 06:42:43 -!- githogori [~githogori@adsl-66-123-22-146.dsl.snfc21.pacbell.net] has quit [Read error: Operation timed out] 06:43:46 lewis1711: if you need this, then you should probably rethink your program design. 06:45:04 Axioplase_: is that short hand for "it's not possible"?:) 06:45:35 Or you may use a scheme with exceptions, catch the undefined exception, and use EVAL in the current environment to define it. But it's not going to be portable, and is not even guaranteed to work. 06:46:22 hmmm 06:46:43 lewis1711: Or you may use a hash-table to store your own dynamic environment 06:47:15 woow 06:47:18 But that's rethinking the design 06:47:23 dynamic environment ? 06:47:24 yeah that does seem overkill 06:47:31 perhaps i need to think of another solution 06:48:24 lewis1711: If you're looking for a static type system there are things such as Typed Racket 06:48:45 Rmind: (my-define (foo bar #!optional (env *env*)) (table-set! env foo bar))) 06:48:50 no it's only this one weird function 06:49:29 Rmind: (define (value-of x #!optional (env *env*)) (table-ref env x 'undefined)) 06:50:38 And there you go. Something ugly like this. That lets you define things even when you're not at the top-level 06:52:26 Anyway, when your source code may access an undefined variable, it means either you're already doing ugly things, or that you're doing things wrong. So, either you pay the price for it, either you fix it 06:53:11 essentially I am trying to write a function that will take a simple piece of arithmetic like '(+ x y z) and evaluate it as much as possible 06:53:33 nilg [~user@85.239.138.109] has joined #scheme 06:53:39 so if x is 3, and y is 4, but z is unknown, it would return '(+ 5 z) 06:53:43 lewis1711: So (+ 1 2 3 a b 3) => (+ 9 a b) ? 06:53:56 hmm 06:53:58 fun 06:54:06 yes 06:54:14 :) 06:54:49 lewis1711: so, you're writing an interpreter. 06:55:00 And thus you have your own env. 06:55:49 Axioplase_: I am not sure. I am a scheme beginner. I very much enjoyed the way scheme was able to use undefined variables as symbols, and as a maths student thought i might like try a bit of very symbolic arithmetic 06:56:22 -!- nilg [~user@85.239.138.109] has quit [Read error: Operation timed out] 06:58:51 lewis1711: I suggest you fist write a program which, given '(+ 1 2 (- 3 4)), returns 2 correctly. 06:59:14 without using scheme's EVAL 06:59:29 Axioplase_: a good suggestion. I'll get onto it 07:00:09 githogori [~githogori@adsl-66-123-22-146.dsl.snfc21.pacbell.net] has joined #scheme 07:00:30 oh ..;)) a beginner 07:00:38 Then, extend it to support (let (x 42) in (+ x x))" returns 84 07:01:34 -!- NNshag [user@chl45-1-88-123-84-8.fbx.proxad.net] has quit [Read error: Operation timed out] 07:02:40 Basically, parse the code (since the quoted expressions are a list (of lists or whatever)), and do your evaluation consequently. 07:03:21 NNshag [user@chl45-1-88-123-84-8.fbx.proxad.net] has joined #scheme 07:03:47 Ah, and binary operators should make your life easier at first. So, just define a simple syntax like (ADD a b), (MUL a b), (NEG a), (SUBSTRACT a b) 07:04:06 where a and b are other expressions or numbers. 07:06:46 lewis1711: you'll find a possible way to do it by googling for "arithmetic expression evaluator in Scheme". When it works, look for "scheme in scheme", and you'll see how to use an environment to extend your evaluator. 07:06:50 *Axioplase_* vanished 07:08:55 Axioplase_: I was going to see if I could do it "by myself", but I guess if I am asking on IRC anyway I may as well succumb:D 07:10:43 lewis1711: Be careful with (- 1 2 3 4 5) 07:10:55 And for that matter (/ 1 2 3 4 5) 07:11:02 *danking* goes to bed 07:11:09 more mysterious warnings 07:13:14 -!- Rmind [~Gmind@113.190.163.233] has left #scheme 07:13:38 -!- jonrafkind [~jon@jonr5.dsl.xmission.com] has quit [Ping timeout: 250 seconds] 07:24:15 -!- mathk [~mathk@194.177.61.33] has quit [Quit: ..zzZzzZ] 07:37:14 gravicappa [~gravicapp@ppp85-140-64-41.pppoe.mtu-net.ru] has joined #scheme 07:51:49 -!- Kerrick2 [~Kerrick@kerrick.student.iastate.edu] has quit [Quit: Kerrick2] 07:53:56 tessier [~treed@mail.copilotco.com] has joined #scheme 07:54:08 -!- tessier [~treed@mail.copilotco.com] has quit [Changing host] 07:54:08 tessier [~treed@kernel-panic/copilotco] has joined #scheme 07:55:16 -!- dralston [~dralston@S010600212986cca8.va.shawcable.net] has quit [Quit: Leaving] 08:03:49 hkBst [~quassel@gentoo/developer/hkbst] has joined #scheme 08:05:36 HG` [~HG@xdsl-92-252-95-12.dip.osnanet.de] has joined #scheme 08:05:43 hmm, it seems to me that exception handling is a bad choice of things to make implementation dependent. though wtf would I know about scheme;) 08:13:07 lewis1711: there's a standard for this: Common Lisp. 08:13:50 Rmind [~Gmind@113.190.163.233] has joined #scheme 08:17:24 pjb: or racket I guess 08:17:43 Yes, but racket is not an ANSI standard... 08:18:15 meh 08:21:09 -!- lewis1711 [~lewis@222-155-31-117.jetstream.xtra.co.nz] has left #scheme 08:29:02 -!- Bridge|A is now known as Bridge| 08:33:00 pjb: It's worse -- it's not even an ASCII standard. Stay away. 08:33:49 Your attempt at humour is illogical. 08:34:01 *pjb* watching a ST-TOS episode. 08:34:54 =.= 08:37:35 *eli* avoids further obvious flames re the supposed glory that "ANSI Standard" entails 08:39:33 eli: well, if you prefer, IIRC, it has been aknowledged as an ISO standard too :-) 08:41:46 IIRC ? 08:42:20 -!- gravicappa [~gravicapp@ppp85-140-64-41.pppoe.mtu-net.ru] has quit [Ping timeout: 245 seconds] 08:42:42 I'll have the cake then. 08:44:03 re: ANSI standard: http://symbo1ics.com/blog/?p=431 08:45:36 Rmind: http://www.acronymfinder.com/IIRC.html 08:46:17 eli: http://www.lispworks.com/documentation/HyperSpec/Front/index.htm is the right url. 08:49:45 pjb: Huh? 08:50:36 eli: Quadrescence is about the PDF sold by ANSI which is low quality. If you want to have a look at the standard, rather use lispworks' edition of the HyperSpec. 08:52:17 I can't even parse that. 08:57:01 mathk_ [~mathk@194.177.61.33] has joined #scheme 08:57:57 -!- tali713 [~user@c-71-195-45-159.hsd1.mn.comcast.net] has quit [Ping timeout: 272 seconds] 09:05:09 -!- pchrist [~spirit@gentoo/developer/pchrist] has quit [Quit: leaving] 09:05:44 pchrist [~spirit@gentoo/developer/pchrist] has joined #scheme 09:07:06 eli: "the pdf of the ANSI standard stinks. Read the Hyperspec on lispwork's website if you want a good quality version of the standard." 09:07:49 -!- Rmind [~Gmind@113.190.163.233] has left #scheme 09:14:45 mmc [~michal@cs27120227.pp.htv.fi] has joined #scheme 09:16:05 araujo [~araujo@190.38.50.25] has joined #scheme 09:16:05 -!- araujo [~araujo@190.38.50.25] has quit [Changing host] 09:16:05 araujo [~araujo@gentoo/developer/araujo] has joined #scheme 09:17:04 MrFahrenheit [~RageOfTho@users-55-82.vinet.ba] has joined #scheme 09:23:28 -!- mmc [~michal@cs27120227.pp.htv.fi] has quit [Ping timeout: 240 seconds] 09:23:45 alaricsp [~alaric@relief.warhead.org.uk] has joined #scheme 09:25:31 -!- drdo [~user@2.208.54.77.rev.vodafone.pt] has quit [Ping timeout: 240 seconds] 09:31:31 -!- alaricsp [~alaric@relief.warhead.org.uk] has quit [Ping timeout: 240 seconds] 09:35:36 -!- Adamant [~Adamant@unaffiliated/adamant] has quit [Quit: Adamant] 09:43:15 fradgers- [~fradgers-@5e0b815c.bb.sky.com] has joined #scheme 09:43:42 -!- Jafet [~Jafet@unaffiliated/jafet] has quit [Quit: Leaving.] 09:43:47 Jafet [~Jafet@unaffiliated/jafet] has joined #scheme 09:46:19 -!- MrFahrenheit [~RageOfTho@users-55-82.vinet.ba] has quit [Ping timeout: 240 seconds] 09:48:29 Rmind [~Gmind@113.190.163.233] has joined #scheme 09:48:37 hi 09:48:39 (define pitago 09:48:41 (lambda (x y) 09:48:43 (define tuple (map (lambda (i) (expt i 2)) (x y))) 09:48:45 (sqrt (+ (car tuple) (cdr tuple))))) 09:49:15 rudybot: (define pitago (lambda (x y) (define tuple (map (lambda (i) (expt i 2)) (x y))) (sqrt (+ (car tuple) (cdr tuple))))) 09:49:15 Rmind: your sandbox is ready 09:49:16 Rmind: Done. 09:49:30 rudybot : (pitago 10 12 ) 09:49:48 ??? 09:50:02 rudybot: r u dead ? 09:50:03 Rmind: I had no X on multiple times on my man machine. primarily because of the constantly shifting goalposts with respect to nvidia drivers of course. but generally thats ok. Of course my dual screen setup is totally hosed again with the "no xorg" approach on it, u 09:50:22 rudybot: (display (pitago 12 10)) 09:50:22 Rmind: error: procedure application: expected procedure, given: 12; arguments were: 10 09:50:28 anyone ? 09:50:31 =.= 09:51:13 Axioplase_: I appreciate the helpful hints, but where did I say that I want to read that thing in any form? 09:52:44 eli: You said you couldn't parse. So, you tried, from where I infer that you had the intention to read (pjb's sentence) 09:55:18 dfkjjkfd [~paulh@145.120.22.20] has joined #scheme 09:56:56 Axioplase_: I didn't understand why pjb referred me to the clhs, in the first place. (I never expressed any interest in it.) 09:58:02 Well, see that with him. 09:59:30 masm [~masm@2.80.153.71] has joined #scheme 10:02:24 rudybot: (define pitago your-paired-values (sqrt (+ (expt (cdr your-paired-values) 2) (expt (car your-paired-values) 2)))) 10:02:26 Rmind: error: eval:1:0: define: bad syntax (multiple expressions after identifier) in: (define pitago your-paired-values (sqrt (+ (expt (cdr your-paired-values) 2) (expt (car your-paired-values) 2)))) 10:02:43 rudybot: (define (pitago your-paired-values) (sqrt (+ (expt (cdr your-paired-values) 2) (expt (car your-paired-values) 2)))) 10:02:44 Rmind: Done. 10:03:06 rudybot: (pitago '( 3 . 4)) 10:03:06 Rmind: ; Value: 5 10:04:11 rudybot: (define (pitago x y) (sqrt (+ (expt x 2) (expt y 2)))) 10:04:11 Rmind: Done. 10:04:20 rudybot (pitago 3 4) 10:04:37 rudybot: (display (pitago 3 4)) 10:04:38 Rmind: ; stdout: "5" 10:08:23 -!- Rmind [~Gmind@113.190.163.233] has left #scheme 10:12:31 wbooze` [~user@xdsl-78-35-172-3.netcologne.de] has joined #scheme 10:14:00 homie` [~user@xdsl-78-35-172-3.netcologne.de] has joined #scheme 10:14:50 -!- wbooze [~user@xdsl-78-35-130-137.netcologne.de] has quit [Ping timeout: 245 seconds] 10:15:14 -!- homie [~user@xdsl-78-35-130-137.netcologne.de] has quit [Ping timeout: 255 seconds] 10:27:05 schmir [~schmir@mail.brainbot.com] has joined #scheme 10:43:05 -!- gapeme [mao@lost.my.eye.rs] has quit [Ping timeout: 272 seconds] 10:44:32 gapeme [mao@lost.my.eye.rs] has joined #scheme 10:46:15 -!- Bridge| is now known as Bridge|A 10:50:18 -!- vu3rdd [~vu3rdd@nat/cisco/x-ceqfbiuzoqxqhtun] has quit [Remote host closed the connection] 10:54:09 minsa [~minsa@c-24-5-121-157.hsd1.ca.comcast.net] has joined #scheme 11:00:40 alaricsp [~alaric@relief.warhead.org.uk] has joined #scheme 11:11:45 -!- cinch- [~cinch@85-127-111-239.dynamic.xdsl-line.inode.at] has quit [Ping timeout: 265 seconds] 11:13:53 cinch [~cinch@85-127-96-92.dynamic.xdsl-line.inode.at] has joined #scheme 11:22:55 jao [~user@74.Red-80-24-4.staticIP.rima-tde.net] has joined #scheme 11:22:55 -!- jao [~user@74.Red-80-24-4.staticIP.rima-tde.net] has quit [Changing host] 11:22:55 jao [~user@pdpc/supporter/professional/jao] has joined #scheme 11:25:23 -!- homie` [~user@xdsl-78-35-172-3.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 11:26:35 -!- wbooze` [~user@xdsl-78-35-172-3.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 11:29:01 xwl [~user@117.79.232.210] has joined #scheme 11:30:52 homie [~user@xdsl-78-35-172-3.netcologne.de] has joined #scheme 11:33:46 wbooze [~user@xdsl-78-35-172-3.netcologne.de] has joined #scheme 11:46:41 how do I check the current working directory in racket ? 12:03:04 ventonegro [~alex@187.51.143.218] has joined #scheme 12:16:26 rudybot: doc current-directory 12:16:27 eli: your racket sandbox is ready 12:16:27 eli: http://docs.plt-scheme.org/reference/Filesystem.html#(def._((quote._~23~25kernel)._current-directory)) 12:16:29 minsa: ^ 12:17:51 -!- Jafet [~Jafet@unaffiliated/jafet] has quit [Quit: Leaving.] 12:17:58 Jafet [~Jafet@unaffiliated/jafet] has joined #scheme 12:18:11 vu3rdd [~vu3rdd@122.166.153.152] has joined #scheme 12:20:51 kingping [~kp@95.70.85.56] has joined #scheme 12:20:55 (moin) 12:32:32 eli: thnx 12:32:51 rudybot: (quote '(1 2 3 4 5)) 12:32:52 minsa: your sandbox is ready 12:32:52 minsa: ; Value: (quote (1 2 3 4 5)) 12:36:04 rudybot: (raise 'foo) 12:36:04 kingping: your sandbox is ready 12:36:05 kingping: error: foo 12:44:55 Fisher [~multimedi@host137-52-static.45-88-b.business.telecomitalia.it] has joined #scheme 12:44:58 hi 12:45:08 I'm intrested in Scheme 12:45:39 welcome to the #scheme channel then 12:45:55 I've bought "Structure and interpretation of computer programs" 12:46:30 now read it :) 12:47:13 what's the instructor manual? 12:47:27 is good to starting? 12:48:03 The instructor manual is an aid for a teacher, that wants to teach his class with the book 12:48:19 gravicappa [~gravicapp@ppp85-140-64-41.pppoe.mtu-net.ru] has joined #scheme 12:48:27 thank you 12:48:34 I must go away 12:48:36 bye 12:48:39 -!- Fisher [~multimedi@host137-52-static.45-88-b.business.telecomitalia.it] has quit [Quit: Sto andando via] 12:49:28 schemers++ 13:00:23 (+ schemers 100500) 13:04:32 aoh: if he passes through SICP then schemers++; 13:05:37 mmc [~michal@cs181178061.pp.htv.fi] has joined #scheme 13:12:19 -!- jao [~user@pdpc/supporter/professional/jao] has quit [Ping timeout: 260 seconds] 13:12:36 -!- Jafet [~Jafet@unaffiliated/jafet] has quit [Remote host closed the connection] 13:12:41 Jafet [~Jafet@unaffiliated/jafet] has joined #scheme 13:15:48 StucKman [~mdione@lakshmi.inria.fr] has joined #scheme 13:15:55 -!- StucKman [~mdione@lakshmi.inria.fr] has left #scheme 13:22:20 Dawgmatix [~dman@123.201.201.253] has joined #scheme 13:23:50 tupi [~david@139.82.89.24] has joined #scheme 13:25:33 jao [~user@74.Red-80-24-4.staticIP.rima-tde.net] has joined #scheme 13:25:33 -!- jao [~user@74.Red-80-24-4.staticIP.rima-tde.net] has quit [Changing host] 13:25:33 jao [~user@pdpc/supporter/professional/jao] has joined #scheme 13:32:38 -!- masm [~masm@2.80.153.71] has quit [Quit: Leaving.] 13:46:08 StucKman [~mdione@lakshmi.inria.fr] has joined #scheme 13:48:07 -!- StucKman [~mdione@lakshmi.inria.fr] has left #scheme 13:52:53 I am trying to make my way through "the scheme programming language" 4th edition as my starting book. how does it contrast to SCIP ? 13:53:02 SICP, I mean. 13:53:03 -!- samth_away is now known as samth 13:53:25 minsa, SICP is a book about computing and programming, and designed as an introductory text 13:53:35 TSPL is a reference book about Scheme 13:54:13 SICP is not specifically about Scheme. Have a look at http://www.codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages 13:54:13 http://tinyurl.com/yvqsht 13:55:47 thnx, I am now making my way through tspl, and so far the exercises are satisfactory. I will return to SICP later. 14:01:32 I am trying to understand a simple case but it turns out not so simple. 14:01:56 (qoute '1) ===> (list 'quote 1) in Racket. 14:02:07 I thought 'quote' is a keyword. 14:02:19 now it becomes a literal value. 14:02:21 '1 === (quote 1) 14:02:36 somnium: I am aware of that. 14:02:59 so (quote (quote 1)) === '(quote 1) 14:03:28 but '((quote 1)) == (list (quote 1)) 14:03:48 oh right. I am only very superficially aware of it. :) 14:03:49 thnx. 14:04:37 StucKman [~mdione@lakshmi.inria.fr] has joined #scheme 14:05:03 -!- StucKman [~mdione@lakshmi.inria.fr] has left #scheme 14:05:29 trigen [~MSX@ec2-46-51-179-218.eu-west-1.compute.amazonaws.com] has joined #scheme 14:06:14 I think what threw me off is the display notation of Racket. 14:06:16 > (quote '(1 2 3 4 5)) 14:06:16 (list 'quote (list 1 2 3 4 5)) 14:06:45 "list" keyword is probably implicity in any list like (1 2 3 4 5) 14:06:58 I think 14:09:13 Adamant [~Adamant@unaffiliated/adamant] has joined #scheme 14:16:52 -!- Adamant [~Adamant@unaffiliated/adamant] has quit [Quit: Adamant] 14:21:46 minsa: It looks like you've changed something in your settings, probably in DrRacket. 14:21:47 nowhereman [~pierre@AStrasbourg-551-1-7-55.w92-141.abo.wanadoo.fr] has joined #scheme 14:21:56 rudybot: eval (quote '(1 2 3 4 5)) 14:21:56 chandler: your racket sandbox is ready 14:21:57 chandler: ; Value: (quote (1 2 3 4 5)) 14:22:40 -!- nowhere_man [~pierre@AStrasbourg-551-1-105-122.w90-13.abo.wanadoo.fr] has quit [Ping timeout: 265 seconds] 14:24:24 -!- Dawgmatix [~dman@123.201.201.253] has quit [Quit: Ex-Chat] 14:25:16 chandler: yes, it was set to "Advanced Student" instead of "R5RS". 14:25:57 in R5RS mode, (quote '(1 2 3 4 5)) still yields '(1 2 3 4 5) 14:27:41 and '(1 2 3 4 5) is definitely different from (list 'quote (list 1 2 3 4 5)) . 14:30:41 rotty: i've tried for quite some time but I am completely unable to understand how to add unittests in guile-lib. I've come this far: http://paste.lisp.org/display/117628 but don't get any failed tests. 14:31:14 rudybot: (list? '(1 2 3 4 5)) 14:31:15 kingping: ; Value: #t 14:33:13 -!- peddie [~peddie@XVM-107.MIT.EDU] has quit [Ping timeout: 276 seconds] 14:33:29 rudybot: (list 'quote (list 1 2 3 4 5)) 14:33:30 minsa: your sandbox is ready 14:33:30 minsa: ; Value: (quote (1 2 3 4 5)) 14:33:54 Dawgmatix [~dman@123.201.201.253] has joined #scheme 14:34:14 peddie [~peddie@XVM-107.MIT.EDU] has joined #scheme 14:35:06 wow, both Racket R5RS and mosh R6RS interpret (list 'quote (list 1 2 3 4 5)) as '(1 2 3 4 5) 14:35:09 what's a miss ? 14:35:34 what interpreter is rudybot using ? 14:35:52 No, they're not *interpreting* it that way. They're printing the result of evaluating that expression. 14:36:07 rudybot is using Racket. 14:36:28 However, this behavior is hardly unique to Racket. 14:37:15 The result of evaluating (list 'quote (list 1 2 3 4 5)) is a list of length 2. The first element of the list is the symbol "quote"; the second element is a list containing the elements "1 2 3 4 5". 14:37:22 That gets printed as (quote (1 2 3 4 5)) . 14:38:29 drdo [~user@2.208.54.77.rev.vodafone.pt] has joined #scheme 14:38:55 chandler: thnx for clarifying. 14:40:27 but in the scheme compiler that I am using: R5RS by Racket and R6RS by Mosh, (list 'quote (list 1 2 3 4 5)) as simply '(1 2 3 4 5) 14:41:31 That's the same thing. 'foo is an alternate syntax for (quote foo) . 14:41:41 they seem to treat quote as keyword rather than literal value. 14:41:59 ok. 14:42:59 chandler: thnx again. I got hit by the same topic two times this morning but I think I got it. 14:47:17 femtoo [~femto@95-89-197-7-dynip.superkabel.de] has joined #scheme 14:55:54 rudybot: (define x 'quote) (x (1 2 3 4 5)) 14:55:54 minsa: error: procedure application: expected procedure, given: 1; arguments were: 2 3 4 5 14:56:35 chandler: I thought quote will be evaluated as built-in expression, what's amiss ? 14:57:48 I was experimenting with macros, and I'm wondering if this is equivalent (in power/safety) to syntax-case. Clojure has this notion of metadata, or extra data that doesn't affect identity/value -- so 'asymbol with no metadata, and 'asymbol with :uid 42, are equal. 15:00:41 Azuvix [~james@174-27-34-218.bois.qwest.net] has joined #scheme 15:02:28 so in the expander, before calling a procedural macro every symbol is tagged with lexical data, then the result is untagged, and (so far at least) it seems to produce hygienic expansions 15:05:00 for me (as the implementor of my toy language) its pleasant to avoid the complexity of a separate type (syntax-objects) for achieving hygiene. but maybe I'm overlooking something/have misunderstood something/haven't read paper X? 15:06:53 tokam [~tokam@p54A7B379.dip.t-dialin.net] has joined #scheme 15:07:01 hi I use drscheme, isthere a debugger? 15:07:07 somnium: FWIW, Chicken does something similar using symbol plists, so it can use plain old (renamed) symbols 15:07:18 -!- peddie [~peddie@XVM-107.MIT.EDU] has quit [Read error: Operation timed out] 15:07:27 So you don't really _need_ a special datatype 15:08:38 It also keeps a syntax environment which allows it to look up the meaning of a renamed symbol 15:08:59 (in the plist it only stores the original name of the symbol) 15:09:09 -!- xwl [~user@117.79.232.210] has quit [Read error: Connection reset by peer] 15:09:23 The syntax environment is available to the renaming and comparison procedures, but not directly accessible to the macro 15:10:01 somnium` [~user@184.42.0.205] has joined #scheme 15:10:57 peddie [~peddie@XVM-107.MIT.EDU] has joined #scheme 15:11:30 -!- somnium [~user@184.42.17.189] has quit [Ping timeout: 245 seconds] 15:13:24 -!- rdd [~rdd@c83-250-48-164.bredband.comhem.se] has quit [Remote host closed the connection] 15:13:49 bweaver [~user@host-68-169-175-225.WISOLT2.epbfi.com] has joined #scheme 15:14:43 to answer my own question for posterity: http://lambda-the-ultimate.org/node/2753 15:14:59 minsa: To understand why ('quote (1 2 3 4 5)) is not the same as (quote (1 2 3 4 5)), you have to understand that symbols don't directly represent the functions (or syntaxes, in this case) they customarily name. 15:15:07 minsa: I'll start you with a simple example. 15:15:23 rudybot: (+ 1 2 3) 15:15:28 cky: your racket sandbox is ready 15:15:28 cky: ; Value: 6 15:15:37 rudybot: (list + 1 2 3) 15:15:37 cky: ; Value: (# 1 2 3) 15:15:43 rudybot: '(+ 1 2 3) 15:15:43 cky: ; Value: (+ 1 2 3) 15:16:24 minsa: In the first example, we call the + procedure. In the second example, we create a list, with the + procedure, then the numbers. In the third example, we have a list with the + _symbol_ (not procedure), and the numbers. 15:16:55 There is no linkage between the + symbol and the + procedure, at least not one that your program can portably access. 15:17:41 So, you could do this: 15:17:54 rudybot: (let ((x +)) (x 1 2 3 4 5)) 15:17:54 cky: ; Value: 15 15:18:05 Whereas this would not work: 15:18:15 rudybot: (let ((x '+)) (x 1 2 3 4 5)) 15:18:15 cky: error: procedure application: expected procedure, given: +; arguments were: 1 2 3 4 5 15:18:31 because in this case, we tried to run a symbol. 15:18:38 s/run/call/ 15:18:53 rdd` [~rdd@c83-250-48-164.bredband.comhem.se] has joined #scheme 15:19:04 -!- rdd` is now known as rdd 15:19:12 Rmind [~Gmind@113.190.163.233] has joined #scheme 15:19:13 Now, "quote" is a syntax, so it's even trickier, because you can't assign that to a variable (unless you're using Guile, but that's a whole other story). 15:19:21 Rmind: Special for you: 15:19:36 rudybot: (define (hypot x y) (sqrt (+ (* x x) (* y y)))) 15:19:37 cky: Done. 15:19:42 rudybot: (hypot 3 4) 15:19:42 cky: ; Value: 5 15:19:53 Rmind: ^---- probably much simpler than what you were trying to do. :-P 15:22:05 aisa [~aisa@173-10-243-253-Albuquerque.hfc.comcastbusiness.net] has joined #scheme 15:25:34 Rmind: If you wanted to get fancy with higher-order functions, you could do this: 15:25:41 rudybot: (require srfi/1) 15:25:42 cky: Done. 15:27:32 rudybot: (define (hypot . xs) (define (square x) (* x x)) (sqrt (reduce + 0 (map square xs)))) 15:27:32 cky: Done. 15:27:37 rudybot: (hypot 3 4) 15:27:38 cky: ; Value: 5 15:27:42 rudybot: (hypot 3 4 5) 15:27:43 cky: ; Value: 7.0710678118654755 15:38:33 -!- copumpkin [~pumpkin@unaffiliated/pumpkingod] has quit [Read error: Operation timed out] 15:42:09 -!- Azuvix [~james@174-27-34-218.bois.qwest.net] has quit [Ping timeout: 240 seconds] 15:42:25 Azuvix [~james@174-27-34-218.bois.qwest.net] has joined #scheme 15:46:12 jewel [~jewel@196-210-134-54.dynamic.isadsl.co.za] has joined #scheme 15:52:05 -!- Dawgmatix [~dman@123.201.201.253] has quit [Quit: Ex-Chat] 15:53:37 -!- kingping [~kp@95.70.85.56] has quit [Quit: Vale.] 16:01:56 cky: thanks 16:02:26 I was trying to use map because I don't want to repeat the function again 16:02:34 copumpkin [~pumpkin@17.101.89.201] has joined #scheme 16:02:34 -!- copumpkin [~pumpkin@17.101.89.201] has quit [Changing host] 16:02:34 copumpkin [~pumpkin@unaffiliated/pumpkingod] has joined #scheme 16:02:50 and yes, take use of higher order 16:03:27 hey, what was "reduce" used for ? 16:03:36 making sauces. 16:03:50 "reduce" is a sort of special-purpose variant of "fold"; I never use it 16:05:28 -!- Riastradh [debian-tor@fsf/member/riastradh] has quit [Remote host closed the connection] 16:05:48 Rmind: (reduce + 0 ...) adds up the values of .... As offby1 said, it's like (fold + 0 ...). 16:06:41 I am looking at the SICP 2.5.2 on type coersions. Need some help understanding the apply-generic procedure described in there. 16:06:43 http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-18.html#%_sec_2.5.2 16:07:06 Rmind: (fold + 0 '(1 2 3 4 5)) is: (+ 5 (+ 4 (+ 3 (+ 2 (+ 1 0))))). 16:07:22 Rmind: (reduce + 0 '(1 2 3 4 5)) is: (+ 5 (+ 4 (+ 3 (+ 2 1)))). 16:07:32 The 0 is only used if the incoming list is empty. 16:09:46 look like fold-left ... ? 16:10:04 kuribas [~user@94-226-138-243.access.telenet.be] has joined #scheme 16:10:07 :) 16:10:12 ah, ok 16:10:42 hrm, does anyone else get a segfault with the blender.scm example linked to by the docs for Chicken's glut egg? 16:11:58 somnium`: I don't. Works for me. 16:12:24 Riastradh [debian-tor@fsf/member/riastradh] has joined #scheme 16:12:25 somnium`: what chicken version are you using? 16:12:37 4.6.0 16:13:02 *mario-goulart* tries with 4.6.0 16:13:09 it very well may be my intel drivers, they've crashed X numerous times 16:13:49 -!- xwl_ [~wixu@nat/nokia/x-ooudkxkafyggcyka] has quit [*.net *.split] 16:13:49 -!- rapacity [~prwg@unaffiliated/rapacity] has quit [*.net *.split] 16:13:49 -!- Euthydemus [~euthydemu@vaxjo7.80.cust.blixtvik.net] has quit [*.net *.split] 16:13:49 -!- yosafbridge [~yosafbrid@li125-242.members.linode.com] has quit [*.net *.split] 16:13:50 -!- roderic [~roderic@zerowing.ccs.neu.edu] has quit [*.net *.split] 16:13:50 -!- clog [nef@bespin.org] has quit [*.net *.split] 16:13:50 -!- Hal9k [~Lernaean@unaffiliated/kusanagi] has quit [*.net *.split] 16:15:27 hmm, Ill try with the latest from git 16:15:54 somnium`: here it works with 4.6.0 too 16:16:03 Debian stable, x86 16:17:50 xwl_ [~wixu@nat/nokia/x-ooudkxkafyggcyka] has joined #scheme 16:17:50 rapacity [~prwg@unaffiliated/rapacity] has joined #scheme 16:17:50 Euthydemus [~euthydemu@vaxjo7.80.cust.blixtvik.net] has joined #scheme 16:17:50 yosafbridge [~yosafbrid@li125-242.members.linode.com] has joined #scheme 16:17:50 roderic [~roderic@zerowing.ccs.neu.edu] has joined #scheme 16:17:50 Hal9k [~Lernaean@unaffiliated/kusanagi] has joined #scheme 16:19:56 -!- snorble [~snorble@s83-179-14-105.cust.tele2.se] has quit [Read error: Connection timed out] 16:20:28 snorble [~snorble@s83-179-14-105.cust.tele2.se] has joined #scheme 16:29:00 cky: I dunno why you still remember my question that I have asked for 5 - 6 hours ago :P 16:29:21 btw, thanks for your memory 16:32:22 Rmind: I don't "remember". I use scrollback. :-) 16:32:34 Rmind: Any decent IRC client can be set up to have a long scrollback. 16:32:44 Rmind: That means I only need to check my IRC about once a day, and catch up on all the conversations. 16:33:20 :P with me , it just happen on the moment I login :)) 16:33:28 Hehehehe. 16:34:06 *Rmind* is listening to FF7CC OST 16:34:45 *Rmind* mean "The Pride of Freedom" 16:37:06 -!- hkBst [~quassel@gentoo/developer/hkbst] has quit [Remote host closed the connection] 16:42:53 mario-goulart: thanks. I'm giving up on this machine. 4.5 from apt segfaulted too. 16:45:37 somnium`: weird. Maybe you can try #chicken or chicken-users@nongnu.org if the segfault persists. 16:46:32 In case the problem is caused by buggy drivers, maybe it's better to try blender.scm with good video drivers. 16:46:59 Ill try with windows later, if it works I'll feel secure in blaming the drivers (again) 16:47:29 Alright. 16:55:25 parolang [~user@c-64-246-121-114.oregonrd-wifi-1261.amplex.net] has joined #scheme 16:57:53 cky: I forgot to ask about the " . " in the define 16:58:31 cky: and my racket don't accept "reduce" or "fold-left" as its command :--?? 17:02:07 -!- jao [~user@pdpc/supporter/professional/jao] has quit [Ping timeout: 250 seconds] 17:04:24 Rmind: Type (require srfi/1) first. 17:04:34 Rmind: reduce, fold, etc. are defined as part of SRFI 1. 17:04:54 The . in the define is for creating variable-argument functionsn. 17:05:10 So, here's the simplest example of such a function: 17:05:19 rudybot: (define (my-list . xs) xs) 17:05:20 cky: Done. 17:05:25 rudybot: (my-list 1 2 3 4) 17:05:26 cky: ; Value: (1 2 3 4) 17:05:30 rudybot: (list 1 2 3 4) 17:05:31 cky: ; Value: (1 2 3 4) 17:05:42 Rmind: ^--- As you can imagine, that's how the "list" function is usually implemented. 17:06:00 So, all it does is take all the arguments you pass it and create a list from it. 17:06:25 In my hypot function, I simply do more with the list (namely, run "map" on it) than just return it. 17:07:16 Rmind: Do you use any other languages like Python or Ruby? If so, that is equivalent to: def my_list(*xs); xs; end (in Ruby) 17:07:48 yep 17:08:09 -!- MichaelRaskin [~MichaelRa@195.178.216.22] has quit [Ping timeout: 272 seconds] 17:08:16 but I haven't ever use that 17:08:51 so " . " accept any args and pass it into a list ? 17:08:57 gosh, I use ``func (*args)'' alla time in Python 17:09:07 maybe that's because I think in Lisp 17:09:08 And can I define my reduce ? 17:09:33 in Lisp, the answer to "can I define" is pretty much always "yes" 17:09:43 :-) 17:09:47 I can't offhand think of something you can't define yourself, apart from calls into the kernel 17:09:52 In Ruby I usually use [] << to pass all objects :X love this symbol 17:10:13 if you can do it in Ruby, you can do it in Lisp, albeit perhaps more verbosely. 17:10:51 it really make senses 17:10:59 :-) 17:11:22 -!- sacho [~sacho@90.154.204.70] has quit [Read error: Connection reset by peer] 17:11:42 -!- femtoo [~femto@95-89-197-7-dynip.superkabel.de] has quit [Read error: Connection reset by peer] 17:12:00 so SRFI isn't kernel function of Scheme :P 17:12:55 cky: if don't use srfi , can you define a reduce or fold-left ? 17:16:36 Yes, quite easily. 17:18:43 -!- drdo [~user@2.208.54.77.rev.vodafone.pt] has quit [Ping timeout: 240 seconds] 17:19:03 how ? 17:19:07 =)) 17:21:32 rudybot: (define (fold1 p init lst) (if (null? lst) init (fold1 p (p (car lst) init) (cdr lst)))) 17:21:33 cky: Done. 17:22:02 rudybot: (define (reduce1 p init lst) (if (null? lst) init (fold1 p (car lst) (cdr list)))) 17:22:02 cky: Done. 17:22:09 Rmind: ^^--- just like that. 17:22:27 Rmind: Except the SRFI 1 version of fold is more general in that it can take multiple lists. 17:23:45 rudybot: (fold1 + 0 '(1 2 3 4 5)) 17:23:45 cky: ; Value: 15 17:23:52 rudybot: (reduce1 + 0 '(1 2 3 4 5)) 17:23:52 cky: error: cdr: expects argument of type ; given # 17:23:58 Oh, typo. 17:24:03 rudybot: (define (reduce1 p init lst) (if (null? lst) init (fold1 p (car lst) (cdr lst)))) 17:24:04 cky: Done. 17:24:07 rudybot: (reduce1 + 0 '(1 2 3 4 5)) 17:24:07 cky: ; Value: 15 17:24:10 :-D 17:24:25 jonrafkind [~jon@crystalis.cs.utah.edu] has joined #scheme 17:24:32 Rmind: ^^--- Does that help at all? :-P 17:26:19 stis [~stis@1-1-1-39a.veo.vs.bostream.se] has joined #scheme 17:28:55 masm [~masm@2.80.153.71] has joined #scheme 17:29:09 -!- yosafbridge [~yosafbrid@li125-242.members.linode.com] has quit [Ping timeout: 240 seconds] 17:31:40 Ragnaroek [~chatzilla@pD9E2787C.dip.t-dialin.net] has joined #scheme 17:32:11 cky: thnx a lot for your explanations. they are helping a lot. 17:32:18 minsa: Glad to hear it. :-) 17:32:35 Yeah, we love you cky 17:32:39 -!- HG` [~HG@xdsl-92-252-95-12.dip.osnanet.de] has quit [Quit: HG`] 17:32:44 Hahahaha, awwww.... 17:32:47 when I do (car (quote '(1 2 3 4))) , I get "quote". 17:32:57 Yep, that's as it should be. 17:33:05 that quote I get is the built-in quote instead of value 'quote, right ? 17:33:14 Remember, (quote '(1 2 3 4)) is the same as '(quote (1 2 3 4)) 17:33:28 drdo [~user@2.208.54.77.rev.vodafone.pt] has joined #scheme 17:33:42 rudybot: '(quote (1 2 3 4)) 17:33:42 minsa: ; Value: (quote (1 2 3 4)) 17:34:00 so final form is just '(1 2 3 4) 17:34:08 Yep. 17:34:11 rudybot: ''(1 2 3 4) 17:34:11 cky: ; Value: (quote (1 2 3 4)) 17:34:16 ^^--- same deal. 17:35:54 <---- digesting.. 17:36:00 :-D 17:38:09 yosafbridge [~yosafbrid@li125-242.members.linode.com] has joined #scheme 17:38:33 -!- mmc [~michal@cs181178061.pp.htv.fi] has quit [Read error: Connection reset by peer] 17:38:36 -!- Riastradh [debian-tor@fsf/member/riastradh] has quit [Ping timeout: 245 seconds] 17:38:44 -!- githogori [~githogori@adsl-66-123-22-146.dsl.snfc21.pacbell.net] has quit [Read error: Connection reset by peer] 17:38:59 Euthydemus` [~euthydemu@vaxjo7.80.cust.blixtvik.net] has joined #scheme 17:40:53 mmc [~michal@cs181178061.pp.htv.fi] has joined #scheme 17:41:29 -!- Euthydemus [~euthydemu@vaxjo7.80.cust.blixtvik.net] has quit [Ping timeout: 240 seconds] 17:43:03 (quote '(1 2 3 4)) is the same as '(1 2 3 4) but the result of (car (quote '(1 2 3 4)) cannot be used as procedure . 17:43:18 that is the crux of my confusion. 17:43:43 right, `quote' is not a procedure, it's a piece of syntax 17:43:45 in the first instance it is seen as nested quote but in the second instance, it's not seen as procedure. 17:44:14 -!- offby1 [~user@pdpc/supporter/monthlybyte/offby1] has quit [Ping timeout: 265 seconds] 17:44:42 quote is not a procedure 17:44:57 note: 17:45:00 rudybot: (apply quote 1) 17:45:06 elly: your sandbox is ready 17:45:06 elly: error: eval:1:7: quote: bad syntax in: quote 17:45:52 From TSPL#$: A quote expression is *not* a procedure application, since it inhibits the evaluation of its subexpression. 17:46:54 indeed 17:47:42 I still need to wrap around "it inhibits the evaluation of its subexpression." 17:48:28 it allows nested quote but quote as obtained from (car (quote '(1 2 3 4))) is not quote expression anymore. 17:48:44 cky: great implementation 17:49:07 (although some parameter or args I don't understand much) 17:49:18 minsa: (quote x) returns x, unevaluated 17:49:39 so the result of (quote (quote x)) is the two-element list (quote x) 17:49:57 and (quote x) is evaluted again ? 17:49:59 try (eval (quote (quote x))) 17:50:02 to 'x ? 17:50:07 you *can* evaluate it again, but it isn't normally 17:50:08 Think of "eval" and "quote" as opposites. 17:50:13 it's just a list, lists don't get evaluated on their own 17:50:47 rudybot: (eval (quote (quote x))) 17:50:47 minsa: ; Value: x 17:50:54 Rmind: You have to read SRFI 1 to understand what the parameters are for. 17:51:30 minsa: In other words, (eval (quote (quote x))) == (quote x) 17:52:07 cky: I can see how the result is a list : (quote x) 17:52:19 cky: ok, I will :P . Let's continue to those guides ... (although I prefer some video lecture :P , let me know if you have some ) 17:52:28 Hahahahaha. 17:52:32 HG` [~HG@xdsl-92-252-127-173.dip.osnanet.de] has joined #scheme 17:52:51 but what I am not sure is when that quote becomes literal or expression. 17:52:55 minsa: I'm going to use an alternative notation to help you. Quoted stuff will be placed in {} brackets. 17:53:16 since the result is a list (qoute x), the quote in there would be a literal ? 17:53:23 minsa: (eval (quote (quote x))) == (eval {(quote x)}) == (quote x) == {x} 17:54:09 cky: I understand the progression. 17:54:59 :-) 17:54:59 -!- Ragnaroek [~chatzilla@pD9E2787C.dip.t-dialin.net] has quit [Remote host closed the connection] 17:55:41 but as soon as I do (car (quote (quote (1 2 3)))) , the quote that comes out changes its semantic meaning. 17:55:48 No, it doesn't. 17:56:06 So, (car (quote (quote (1 2 3)))) == (car {(quote (1 2 3))}) 17:56:24 i.e., what's inside the {} is a list, where the first item is the quote _symbol_. 17:56:47 Remember my example where I demonstrate that (+ 1 2 3) is different from ('+ 1 2 3)? 17:56:55 yes. 17:57:10 Right. So, here, you're doing: (car ('quote '(1 2 3))). 17:57:48 Well, not exactly, but close enough. 17:57:58 -!- drdo [~user@2.208.54.77.rev.vodafone.pt] has quit [Remote host closed the connection] 17:58:07 (Should be (car (list 'quote '(1 2 3))) instead.) 17:58:14 drdo [~user@2.208.54.77.rev.vodafone.pt] has joined #scheme 17:58:35 rudybot: (list 'quote '(1 2 3)) 17:58:35 cky: ; Value: (quote (1 2 3)) 17:58:56 that is quote __symbol__ . 17:58:59 Yes. 17:59:36 rudybot: (equal? (quote (quote (1 2 3))) (list 'quote '(1 2 3))) 17:59:36 cky: ; Value: #t 17:59:44 rudybot: (car '(quote (1 2 3 4))) 17:59:44 minsa: ; Value: quote 18:00:06 rudybot: (equal? '(quote (1 2 3 4)) (list 'quote '(1 2 3 4))) 18:00:06 cky: ; Value: #t 18:00:13 so this quote is also __symbol__ ? 18:00:16 Yes. 18:01:03 rudybot: (quote (quote (quote (1 2 3 4)))) 18:01:03 minsa: ; Value: (quote (quote (1 2 3 4))) 18:01:22 those two quotes inside are __symbol__ or __expression__ ? 18:01:29 minsa: Symbols. 18:01:38 There are no expressions once you start quoting. 18:02:38 rudybot: (quote (quote (1 2 3 4))) 18:02:38 minsa: ; Value: (quote (1 2 3 4)) 18:03:00 -!- vu3rdd [~vu3rdd@122.166.153.152] has quit [Remote host closed the connection] 18:03:10 Riastradh [debian-tor@fsf/member/riastradh] has joined #scheme 18:03:25 in R5RS that I am using from Racket, (quote (quote (1 2 3 4))) is evaluated as '(1 2 3 4) 18:04:14 clog [nef@bespin.org] has joined #scheme 18:05:30 that's the beginning of expression. 18:05:42 confusion, I mean. 18:06:37 -!- dfkjjkfd [~paulh@145.120.22.20] has quit [Quit: Lost terminal] 18:07:33 cky: you and others have explained a lot but my thick head is not picking up all of it. Maybe after some more reading and writing, I will come to. 18:08:18 minsa: try: (car (quote (quote (1 2 3 4)))) and (cdr (quote (quote (1 2 3 4)))) 18:09:30 minsa: the problem you have is because since there's a syntax to read 'x as the list (quote x), and the lisp printer will print the list (quote x) as 'x, you may be oblivious of the fact that 'x is actually a list of two items, the symbol quote and x. 18:10:22 minsa: then you have to be careful when you write objects. Often people write expressions that would produce the object when evaluated. IMO this is confusing. 18:10:59 minsa: so when you speak of the list that contains the number 1, 2, 3, and 4, you should write (1 2 3 4), not '(1 2 3 4), because the later is actually read as (quote (1 2 3 4)) which is a list of two items. 18:12:58 -!- tupi [~david@139.82.89.24] has quit [Quit: Leaving] 18:16:03 pjb: (cdr (quote (quote(1 2 3 4)))) is evaluated to ((1 2 3 4)) 18:16:03 forcer [~forcer@d149090.adsl.hansenet.de] has joined #scheme 18:16:09 Yes. 18:16:13 instead of (quote (1 2 3 4)) 18:16:17 It's a list that contains the rest of the elements. 18:16:42 I was still expecting (quote (1 2 3 4)) 18:16:45 the car of (quote (1 2 3 4)) is the symbol quote; the cdr of (quote (1 2 3 4)) is the list that contains (1 2 3 4), that is: ((1 2 3 4)). 18:17:08 ah.. yes, the result of car is a list by definition. 18:17:14 No. 18:17:20 cdr, I mean. 18:17:24 result of cdr. 18:17:43 If the argument is a list, then the result of cdr is either a list, or the end-of-list token, (). 18:18:00 minsa: but (cdr (cons 'a 'b)) == b which is a symbol. 18:18:05 rudybot: (cdr ('a . 'b)) 18:18:05 minsa: error: eval:1:11: quote: bad syntax in: quote 18:18:20 rudybot: (cdr (cons 'a 'b)) 18:18:20 pjb: your r5rs sandbox is ready 18:18:20 pjb: ; Value: b 18:18:37 rudybot: (cons 'a 'b) 18:18:37 minsa: ; Value: (a . b) 18:19:19 so (cons 'a 'b) is not the same as ('a . 'b) ? 18:19:21 minsa: (cdr ('a . 'b)) is read as (cdr ((quote a) . (quote b))) and (quote a) evaluates to the SYMBOL A, which is not a procedure, therefore ((quote a) . (quote b)) cannot be a procedure call, hence the error. 18:19:28 minsa: indeed. 18:19:42 rudybot: (equal '(cons 'a 'b) '('a . 'b)) 18:19:42 pjb: error: reference to an identifier before its definition: equal in module: 'program 18:19:48 rudybot: (equal? '(cons 'a 'b) '('a . 'b)) 18:19:48 pjb: ; Value: #f 18:21:23 (cons 'a 'b) would return (a . b). (quote (a . b)) would return (a . b). The main difference is that cons will always return a new pair, while quote will always return the same value: its argument. 18:23:00 <--- digesting. 18:23:09 and thnx. 18:32:42 -!- Rmind [~Gmind@113.190.163.233] has left #scheme 18:38:53 -!- Dark-Star|Zzz [~michael@HSI-KBW-095-208-117-017.hsi5.kabel-badenwuerttemberg.de] has quit [] 18:39:11 Dark-Star|Zzz [~michael@HSI-KBW-095-208-117-017.hsi5.kabel-badenwuerttemberg.de] has joined #scheme 18:39:19 -!- Dark-Star|Zzz is now known as Dark-Star 18:45:53 mathk__ [~mathk@lns-bzn-44-82-249-238-201.adsl.proxad.net] has joined #scheme 18:47:51 Ragnaroek [~chatzilla@pD9E2787C.dip.t-dialin.net] has joined #scheme 18:49:29 -!- mathk_ [~mathk@194.177.61.33] has quit [Ping timeout: 260 seconds] 18:50:11 Let's try something fun.... 18:50:20 oh boy! 18:50:21 rudybot: (define a (cons 1 2)) 18:50:21 cky: Done. 18:50:27 rudybot: (set-car! a 'foo) 18:50:27 cky: error: reference to an identifier before its definition: set-car! in module: 'program 18:50:33 rudybot: init r5rs 18:50:34 cky: your r5rs sandbox is ready 18:50:39 rudybot: (define a (cons 1 2)) 18:50:39 cky: Done. 18:50:47 rudybot: (set-car! a 'foo) 18:50:47 cky: Done. 18:50:53 rudybot: (define a '(1 . 2)) 18:50:54 cky: Done. 18:50:59 rudybot: (set-car! a 'foo) 18:51:00 cky: Done. 18:51:02 a 18:51:05 rudybot: a 18:51:05 cky: ; Value: {foo . 2} 18:51:12 Hmmmm. 18:51:30 Darn it. Not quite the example I was thinking of. Hmm. 18:53:46 Rmind [~Gmind@113.190.163.233] has joined #scheme 18:53:58 -!- Rmind [~Gmind@113.190.163.233] has left #scheme 18:55:41 tali713` [~user@c-71-195-45-159.hsd1.mn.comcast.net] has joined #scheme 18:56:39 -!- tali713` is now known as tali713 18:58:47 -!- chemuduguntar [~ravi@118-92-129-45.dsl.dyn.ihug.co.nz] has quit [Remote host closed the connection] 19:00:34 -!- cipher [~cipher@c-76-24-16-225.hsd1.ma.comcast.net] has quit [Quit: leaving] 19:03:46 j6dyck [~jeff@129-97-233-206.uwaterloo.ca] has joined #scheme 19:06:41 -!- copumpkin [~pumpkin@unaffiliated/pumpkingod] has quit [Ping timeout: 255 seconds] 19:08:40 -!- HG` [~HG@xdsl-92-252-127-173.dip.osnanet.de] has quit [Quit: Leaving.] 19:09:59 copumpkin [~pumpkin@17.101.89.201] has joined #scheme 19:09:59 -!- copumpkin [~pumpkin@17.101.89.201] has quit [Changing host] 19:09:59 copumpkin [~pumpkin@unaffiliated/pumpkingod] has joined #scheme 19:10:41 githogori [~githogori@96.sub-75-208-75.myvzw.com] has joined #scheme 19:11:35 Nils^ [hammerfest@gateway/shell/devio.us/x-qawezuegvbfrjhwx] has joined #scheme 19:13:42 MichaelRaskin [~MichaelRa@195.91.224.225] has joined #scheme 19:15:09 Belaf [~campedel@194.209.131.192] has joined #scheme 19:15:17 -!- Belaf [~campedel@194.209.131.192] has left #scheme 19:17:13 noonian [~noonian@c-98-232-230-23.hsd1.or.comcast.net] has joined #scheme 19:21:37 -!- Azuvix [~james@174-27-34-218.bois.qwest.net] has quit [Quit: Leaving] 19:28:31 Nairod [4efbad19@gateway/web/freenode/ip.78.251.173.25] has joined #scheme 19:28:39 hello 19:29:08 Anyone who often use bigloo here? 19:29:33 I am trying it, but I don't understand its IO model 19:30:18 How can I read big blocks of binary data with it? All IO functions I saw are about strings/bstrings 19:30:28 does it handle buffers as bstring? 19:31:45 An other question but about PLT and opengl, I tried using bitmaps with gl-lists but my code doesn't work, I don't know why 19:35:55 Nairod, about opengl, I would post on the racket mailing list 19:36:26 ok I will try 19:47:18 -!- j6dyck [~jeff@129-97-233-206.uwaterloo.ca] has quit [Remote host closed the connection] 19:47:27 -!- tokam [~tokam@p54A7B379.dip.t-dialin.net] has left #scheme 19:56:15 eldragon [~eldragon@84.79.67.254] has joined #scheme 20:00:14 -!- homie [~user@xdsl-78-35-172-3.netcologne.de] has quit [Read error: Connection reset by peer] 20:00:14 -!- wbooze [~user@xdsl-78-35-172-3.netcologne.de] has quit [Remote host closed the connection] 20:01:19 wbooze [~user@xdsl-78-35-172-3.netcologne.de] has joined #scheme 20:01:22 homie [~user@xdsl-78-35-172-3.netcologne.de] has joined #scheme 20:02:45 -!- jewel [~jewel@196-210-134-54.dynamic.isadsl.co.za] has quit [Ping timeout: 245 seconds] 20:10:33 -!- Jafet [~Jafet@unaffiliated/jafet] has quit [Ping timeout: 272 seconds] 20:12:00 Mandar [~armand@pha75-21-78-228-186-233.fbx.proxad.net] has joined #scheme 20:13:06 -!- parolang [~user@c-64-246-121-114.oregonrd-wifi-1261.amplex.net] has quit [Quit: Enough IRC for today.] 20:15:37 -!- homie [~user@xdsl-78-35-172-3.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 20:16:07 -!- wbooze [~user@xdsl-78-35-172-3.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 20:17:47 -!- em [~em@unaffiliated/emma] has quit [Ping timeout: 255 seconds] 20:20:08 wbooze [~user@xdsl-78-35-172-3.netcologne.de] has joined #scheme 20:20:50 -!- tali713 [~user@c-71-195-45-159.hsd1.mn.comcast.net] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 20:26:29 -!- mmc [~michal@cs181178061.pp.htv.fi] has quit [Ping timeout: 240 seconds] 20:27:41 bigloo user? 20:27:50 -!- joast [~rick@76.178.178.72] has quit [Ping timeout: 240 seconds] 20:28:10 looking for a bigloo user :( 20:32:07 you won't find many around here 20:32:19 I don't think there are many Bigloo users here. 20:35:03 MrFahrenheit [~RageOfTho@users-33-77.vinet.ba] has joined #scheme 20:36:11 homie [~user@xdsl-78-35-172-3.netcologne.de] has joined #scheme 20:38:10 -!- Mandar [~armand@pha75-21-78-228-186-233.fbx.proxad.net] has quit [Quit: Quitte] 20:38:13 is there a XOR logical operator in scheme? 20:40:53 Azuvix [~james@174-27-34-218.bois.qwest.net] has joined #scheme 20:43:35 RageOfThou [~RageOfTho@users-33-77.vinet.ba] has joined #scheme 20:43:51 joast [~rick@CPE-76-178-178-72.natnow.res.rr.com] has joined #scheme 20:44:38 i dont think so, but i think you could define it as a procedure pretty easily 20:44:53 Caleb--: not equals? :P 20:46:49 -!- MrFahrenheit [~RageOfTho@users-33-77.vinet.ba] has quit [Ping timeout: 240 seconds] 20:46:53 (define (xor a b) (or (and a (not b)) (and (not a) b))) 20:47:17 -!- drdo [~user@2.208.54.77.rev.vodafone.pt] has quit [Remote host closed the connection] 20:47:35 drdo [~user@2.208.54.77.rev.vodafone.pt] has joined #scheme 20:47:37 or just (not (equal? a b)) 20:48:41 Rmind [~Gmind@113.190.163.233] has joined #scheme 20:49:13 (define (xor a b) (not (and a b))) 20:49:15 since everything except #f is considered true in scheme i dont think that works 20:49:16 i guess that would do it 20:50:08 (xor #f #f) should be #f right? 20:50:24 oh, right.... 20:50:35 Check your truth tables, Caleb--. Is xor = nand? 20:51:33 -!- Rmind [~Gmind@113.190.163.233] has left #scheme 20:51:59 Adamant [~Adamant@c-68-51-145-83.hsd1.ga.comcast.net] has joined #scheme 20:51:59 -!- Adamant [~Adamant@c-68-51-145-83.hsd1.ga.comcast.net] has quit [Changing host] 20:51:59 Adamant [~Adamant@unaffiliated/adamant] has joined #scheme 20:52:17 no, it's the negation of the logical biconditional 20:53:05 (xor #t #f) (xor #f #t) are the only cases where it should be true 20:54:05 that's kinda crazy. why would you pay for the PDF and get a poor quality version? 20:58:03 -!- ventonegro [~alex@187.51.143.218] has quit [Quit: ventonegro] 21:00:18 argh 21:01:14 does pasting through http://paste.lisp.org/new/scheme works for anyone? 21:01:43 i get to a blank page once i submit 21:01:54 http://paste.lisp.org/display/117664 21:02:07 i'm getting an error on line 9: 21:02:11 procedure application: expected procedure, given: #f; arguments were: #t 21:02:14 any idea why? 21:02:37 -!- Ragnaroek [~chatzilla@pD9E2787C.dip.t-dialin.net] has quit [Remote host closed the connection] 21:05:32 n//m 21:05:32 n/m 21:05:49 too many parentheses 21:10:08 -!- ecraven [~user@140.78.42.213] has quit [Quit: bbl] 21:14:26 thats classic hehe 21:21:23 i also did cdr instead cadr :( 21:21:29 took me a while to figure that one out 21:21:31 -!- Riastradh [debian-tor@fsf/member/riastradh] has quit [Ping timeout: 245 seconds] 21:23:24 Riastradh [debian-tor@fsf/member/riastradh] has joined #scheme 21:33:20 -!- schmir [~schmir@mail.brainbot.com] has quit [Remote host closed the connection] 21:43:07 -!- gravicappa [~gravicapp@ppp85-140-64-41.pppoe.mtu-net.ru] has quit [Ping timeout: 240 seconds] 21:53:18 mwolfe [~mwolfe@corona.cornerturn.com] has joined #scheme 21:56:42 -!- aisa [~aisa@173-10-243-253-Albuquerque.hfc.comcastbusiness.net] has quit [Quit: aisa] 22:00:12 dfkjjkfd [~paulh@145.120.22.20] has joined #scheme 22:04:09 dfkjjkfd_ [~paulh@145.120.22.20] has joined #scheme 22:05:29 hey schemelings. I have a list of n items e.g. (a b c d) and I want to write a function that combines two members. any member with each. I know that there are n! / k! (n-k)! possibilities but I don't know how to create them 22:06:36 -!- drdo [~user@2.208.54.77.rev.vodafone.pt] has quit [Remote host closed the connection] 22:06:52 drdo [~user@2.208.54.77.rev.vodafone.pt] has joined #scheme 22:08:17 -!- mathk__ [~mathk@lns-bzn-44-82-249-238-201.adsl.proxad.net] has quit [Read error: Connection reset by peer] 22:08:28 mathk_ [~mathk@lns-bzn-23-82-248-78-249.adsl.proxad.net] has joined #scheme 22:08:46 You mean, choose one element of the list (at random?) and then `combine' it with each of the other elements? 22:08:49 -!- mathk_ [~mathk@lns-bzn-23-82-248-78-249.adsl.proxad.net] has quit [Client Quit] 22:10:01 looping through with (list-ref (length - n) list) and combine with a subloop (list-ref (length + x - n) 22:10:18 and x is the-tail length.... something like this 22:10:29 -!- joast [~rick@CPE-76-178-178-72.natnow.res.rr.com] has quit [Ping timeout: 240 seconds] 22:10:37 so I guess the question is: nested loop or is there something better? 22:10:58 -!- Nairod [4efbad19@gateway/web/freenode/ip.78.251.173.25] has quit [Quit: Page closed] 22:11:32 fds: not at random. Choose each and combine it with each right of it in the the list. 22:12:16 I'd do it by `doubly-recursing' through the list 22:12:35 But, I'm not an expert, heh. I'm just trying to make the channel look lively :-P 22:13:20 I guess that's equivalent to nested looping 22:13:38 a nested loop will certainly work, yes. I think I was searching if something like map or for-each would work. But they have not index (I think) so I would not know what is right of the current item. 22:14:08 True, I guess you could recurse once and use map 22:14:22 At each recursion 22:15:12 but map will get each item, including the ones left of the current value and itself, too 22:16:51 you can write a filter procedure to filter the current item out then 22:17:35 You wouldn't need to filter it, just separate the car and cdr 22:18:25 yeah, maybe you're right 22:18:27 Then possibly `reduce' the cdr with a function containing the car, or something 22:18:49 Sorry I can't be more useful, I should be working :s 22:28:19 Nils^: is that a homework problem? 22:29:24 -!- stis [~stis@1-1-1-39a.veo.vs.bostream.se] has quit [Remote host closed the connection] 22:29:35 schmir [~schmir@p54A91C7B.dip0.t-ipconnect.de] has joined #scheme 22:32:14 http://java.dzone.com/news/9-programming-languages-watch 22:33:33 somnium`: no, I am far from dooing any homework anymore :) 22:33:51 I already have it, nesting loops with list-ref and an offset 22:33:55 -!- puddingpimp [ipjesgyv@118-93-180-173.dsl.dyn.ihug.co.nz] has quit [Ping timeout: 240 seconds] 22:36:00 -!- Azuvix [~james@174-27-34-218.bois.qwest.net] has quit [Quit: Leaving] 22:36:58 -!- dfkjjkfd_ [~paulh@145.120.22.20] has quit [Quit: Lost terminal] 22:39:06 ah, its even easier with list-tail 22:39:13 (define (cp xs) (if (empty? xs) '() (append (map (lambda (x) (list (first xs) x)) (rest xs)) (cp (rest xs))))) 22:39:13 22:39:45 map? 22:39:57 I can't read this right away, but I think it will not produce this: 22:40:11 (a b c d) -> ab ac ad, bc bd, cd 22:40:27 '(1 2 3 4 5) -> '((1 2) (1 3) (1 4) ...) 22:40:28 ba ca da are forbidden 22:40:45 ah 22:41:12 the function has to look only to the right sight of the current member-A. 22:41:30 But like I said, I have this with list-tail 22:41:30 eh? no thats what it does I think, the set of unique pairs 22:41:45 unique, yes. Maybe it does, I can't read it. 22:46:53 -!- drdo [~user@2.208.54.77.rev.vodafone.pt] has quit [Remote host closed the connection] 22:46:56 puddingpimp [npetbx@118-93-162-219.dsl.dyn.ihug.co.nz] has joined #scheme 22:47:03 -!- weinholt [weinholt@debian/emeritus/weinholt] has quit [Ping timeout: 250 seconds] 22:47:12 drdo [~user@2.208.54.77.rev.vodafone.pt] has joined #scheme 22:47:56 tali713 [~user@2001:468:1910:3c06:20c:29ff:fe9a:2772] has joined #scheme 22:49:46 weinholt [weinholt@debian/emeritus/weinholt] has joined #scheme 22:52:19 -!- RageOfThou [~RageOfTho@users-33-77.vinet.ba] has quit [Ping timeout: 240 seconds] 22:53:56 em [~em@unaffiliated/emma] has joined #scheme 22:54:00 -!- bweaver [~user@host-68-169-175-225.WISOLT2.epbfi.com] has quit [Ping timeout: 245 seconds] 22:55:29 -!- Hal9k [~Lernaean@unaffiliated/kusanagi] has quit [Ping timeout: 240 seconds] 22:58:18 joast [~rick@CPE-76-178-178-72.natnow.res.rr.com] has joined #scheme 23:05:03 homie` [~user@xdsl-78-35-130-48.netcologne.de] has joined #scheme 23:05:12 wbooze` [~user@xdsl-78-35-130-48.netcologne.de] has joined #scheme 23:07:09 -!- kuribas [~user@94-226-138-243.access.telenet.be] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 23:07:53 -!- wbooze [~user@xdsl-78-35-172-3.netcologne.de] has quit [Ping timeout: 264 seconds] 23:07:54 -!- homie [~user@xdsl-78-35-172-3.netcologne.de] has quit [Ping timeout: 260 seconds] 23:17:21 turbofail [~user@adsl-99-50-22-193.dsl.pltn13.sbcglobal.net] has joined #scheme 23:19:52 -!- tali713 [~user@2001:468:1910:3c06:20c:29ff:fe9a:2772] has quit [Read error: Operation timed out] 23:21:16 -!- githogori [~githogori@96.sub-75-208-75.myvzw.com] has quit [Remote host closed the connection] 23:23:55 tali713 [~user@x-160-94-179-189.cs.umn.edu] has joined #scheme 23:27:51 -!- fradgers- [~fradgers-@5e0b815c.bb.sky.com] has left #scheme 23:31:53 -!- schmir [~schmir@p54A91C7B.dip0.t-ipconnect.de] has quit [Ping timeout: 264 seconds] 23:31:57 -!- nowhereman [~pierre@AStrasbourg-551-1-7-55.w92-141.abo.wanadoo.fr] has quit [Ping timeout: 260 seconds] 23:34:14 nowhereman [~pierre@AStrasbourg-551-1-53-235.w83-194.abo.wanadoo.fr] has joined #scheme 23:39:52 -!- cinch [~cinch@85-127-96-92.dynamic.xdsl-line.inode.at] has quit [Ping timeout: 276 seconds] 23:41:35 Hal9k [~Lernaean@24-107-60-232.dhcp.stls.mo.charter.com] has joined #scheme 23:41:35 -!- Hal9k [~Lernaean@24-107-60-232.dhcp.stls.mo.charter.com] has quit [Changing host] 23:41:35 Hal9k [~Lernaean@unaffiliated/kusanagi] has joined #scheme 23:44:41 -!- masm [~masm@2.80.153.71] has quit [Quit: Leaving.] 23:45:59 -!- wbooze` [~user@xdsl-78-35-130-48.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 23:47:58 -!- homie` [~user@xdsl-78-35-130-48.netcologne.de] has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 23:55:14 Jafet [~Jafet@unaffiliated/jafet] has joined #scheme