2015-12-25T00:01:11Z Shadox joined #scheme 2015-12-25T00:08:59Z nilg quit (Remote host closed the connection) 2015-12-25T00:24:24Z Fare: wasamasa, not with the regular reader, but you can define your own reader macro for #\. 2015-12-25T00:24:58Z wasamasa: Fare: and then I could use #... or would it need to be #\.\.\.? 2015-12-25T00:25:18Z Fare: It can be whatever you want 2015-12-25T00:26:05Z Fare: although there is a discipline to follow when customizing readtables in CL 2015-12-25T00:26:30Z Fare: I recommend using named-readtables 2015-12-25T00:27:12Z Fare: and hopefully asdf 3.2 will have more robust behavior in presence of non-standard readtables. 2015-12-25T00:34:49Z Beluki quit (Quit: Beluki) 2015-12-25T00:37:15Z badkins_ joined #scheme 2015-12-25T00:37:40Z badkins quit (Ping timeout: 245 seconds) 2015-12-25T00:38:55Z Fare quit (Ping timeout: 260 seconds) 2015-12-25T00:40:05Z oleo_ joined #scheme 2015-12-25T00:42:46Z oleo quit (Ping timeout: 250 seconds) 2015-12-25T00:50:44Z Fare joined #scheme 2015-12-25T00:57:35Z Steverman quit (Ping timeout: 265 seconds) 2015-12-25T01:06:24Z neoncontrails quit (Remote host closed the connection) 2015-12-25T01:07:38Z neoncontrails joined #scheme 2015-12-25T01:14:17Z nowhereman joined #scheme 2015-12-25T01:14:52Z nowhere_man quit (Ping timeout: 272 seconds) 2015-12-25T01:19:18Z lambda-11235 joined #scheme 2015-12-25T01:20:00Z Necrosporus: What is #(a b c) ? 2015-12-25T01:20:54Z Fare quit (Ping timeout: 250 seconds) 2015-12-25T01:21:51Z nowhereman is now known as nowhere_man 2015-12-25T01:27:52Z pjb` joined #scheme 2015-12-25T01:29:31Z Mokuso joined #scheme 2015-12-25T01:30:23Z pjb quit (Ping timeout: 276 seconds) 2015-12-25T01:37:43Z jcowan: Necrosporus: A vector containing the symbols a, b, and c in that order. 2015-12-25T01:38:14Z pjb` is now known as pjb 2015-12-25T01:38:23Z Necrosporus: is it different from list? 2015-12-25T01:39:29Z Necrosporus: except implementation 2015-12-25T01:43:11Z physixer joined #scheme 2015-12-25T01:43:38Z jyc: What is that question supposed to mean? :) 2015-12-25T01:43:55Z jyc: it is a different type 2015-12-25T01:44:18Z physixer: can I define a symbol as an alias for a function. e.g., would (define first car) work? so for (car somelist) I used (first somelist) instead? 2015-12-25T01:45:43Z Fare joined #scheme 2015-12-25T01:47:15Z physixer: it doesn't work. I have to do this: (define (first l) (car l)). The need to use l seems superfluous. Can we just do something simpler? 2015-12-25T01:50:36Z fizzie: There shouldn't be anything wrong with (define first car); it works for me. 2015-12-25T01:51:24Z physixer: fizzie: oh really, that's great. Then it must be my incomplete scheme since I'm using an educational version (HtDP's BSL) 2015-12-25T01:52:10Z pjb: wasamasa: no, tokens consisting only of dots are reserved to implementations, and cannot be read conformingly in CL. 2015-12-25T01:52:43Z Shadox quit (Quit: Leaving) 2015-12-25T01:52:48Z pjb: wasamasa: however, you can read a symbol whose names contains only dots: \... or |...| 2015-12-25T01:52:56Z pjb: wasamasa: including a single dot: \. 2015-12-25T01:55:56Z pjb: educational languages are crazy. They spent millions of man.hours designing scheme so that there's a single simple concept of variable for all lisp objects, and they introduce again an asymetry preventing (define first car)! 2015-12-25T01:56:03Z pjb: What kind of education is that? 2015-12-25T01:56:04Z fizzie: physixer: The "student" languages do seem to make a non-standard distinction between "functions" and (non-function) "variables", that's probably the reason. 2015-12-25T01:57:50Z Necrosporus: rudybot, (define (rember a lat) (cond ((null? lat) '()) ((eq? (car lat) a) (cdr lat)) (else (cons (car lat) (rember a (cdr lat)))))) 2015-12-25T01:57:51Z rudybot: Necrosporus: Done. 2015-12-25T01:58:21Z Necrosporus: rudybot, (rember 'a '(aa a b c d e a b)) 2015-12-25T01:58:21Z rudybot: Necrosporus: ; Value: '(aa b c d e a b) 2015-12-25T02:00:43Z pjb: Shouldn't you remove all occurences? 2015-12-25T02:01:42Z jcowan: pjb: It's bicycle training wheels 2015-12-25T02:03:08Z physixer: fizzie: got it. 2015-12-25T02:03:50Z zhcy joined #scheme 2015-12-25T02:04:07Z Regulator9 joined #scheme 2015-12-25T02:04:24Z physixer: another question: how do I pretty-print a list? I have this function available that I can use like (write-file 'stdout "hello, world"). Now if I have a list of strings and I want to print each element by recursive iteration, I'm stuck. 2015-12-25T02:04:56Z physixer: cz for the non-base case I need to do two things: (write-file 'stdout (car L)) and (print-file (cdr L)) 2015-12-25T02:05:02Z physixer: how do I do two things? 2015-12-25T02:05:16Z physixer: sorry print-list not print-file 2015-12-25T02:06:10Z physixer: (define (print-list L) (if (empty? L) (write-file 'stdout "") ( (write-file 'stdout (car L)) (print-list (cdr L)) ) ) 2015-12-25T02:06:12Z physixer: can I do this? 2015-12-25T02:06:50Z pjb: No, since wirte-file doesn't return a function. 2015-12-25T02:06:54Z wildlander quit (Quit: Saliendo) 2015-12-25T02:07:10Z pjb: Don't put spaces around parentheses. 2015-12-25T02:08:04Z Guest21308 quit (Ping timeout: 272 seconds) 2015-12-25T02:08:05Z physixer: so I guess I have to do something like: (write-file 'stdout (list-to-string thelist)) and then define list-to-string? 2015-12-25T02:08:10Z pjb: What's wrong with (write list file)? 2015-12-25T02:08:23Z pjb: Or for stdout, (write list) ? 2015-12-25T02:08:48Z pjb: rudybot: (write '(hello rudy)) 2015-12-25T02:08:48Z rudybot: pjb: ; stdout: "(hello rudy)" 2015-12-25T02:08:51Z physixer: I'm trying to create it from more primitive things, for learning (going through HtDP) 2015-12-25T02:08:54Z pjb: at least, this is standard. 2015-12-25T02:09:10Z pjb: Oh, then yes. 2015-12-25T02:09:43Z physixer: pjb: this is still not formatted. I want just hello then newline (\n) then just rudy. 2015-12-25T02:09:50Z physixer: hello 2015-12-25T02:09:52Z physixer: rudy 2015-12-25T02:09:55Z pjb: An empty list is represented by "()" and a non empty list by "(elements…)" elements being separated by a space. 2015-12-25T02:11:28Z pjb: Now pretty printing is a complex subject. For a start, you may want to just insert newlines and to align under the opening parenthesis. For this, you need to keep track of the column, and formating the element, take its length and check if column+length > maxwidth. 2015-12-25T02:11:59Z pjb: physixer: check: http://www.softwarepreservation.org/projects/LISP/MIT/AIM-279-Goldstein-Pretty_Printing.pdf 2015-12-25T02:12:00Z rudybot: http://teensy.info/L3VprLTPgr 2015-12-25T02:13:47Z physixer: this worked: (define (list-to-string L) (if (empty? L) "" (string-append (car L) "\n" (list-to-string (cdr L))))) 2015-12-25T02:14:16Z aap_ joined #scheme 2015-12-25T02:14:40Z pjb: An empty list is represented by "()", not by "". "" doesn't represent anything. 2015-12-25T02:14:54Z pjb: And you are missing parentheses around the list in the other case too. 2015-12-25T02:15:29Z physixer: pjb: I'm returning a long string (consisting of all the strings separated by newlines) not a list 2015-12-25T02:15:30Z physixer: it works 2015-12-25T02:15:55Z physixer: I use it like this: (write-file 'stdout (list-to-string mylist)) 2015-12-25T02:17:15Z aap quit (Ping timeout: 245 seconds) 2015-12-25T02:17:25Z physixer: I'm using BSL mode in DrRacket (#racket is kinda deserted atm) 2015-12-25T02:17:35Z cemerick joined #scheme 2015-12-25T02:18:28Z physixer: christmast came early for me this year. As a noob, I made my own list-to-string function! 2015-12-25T02:18:37Z physixer: *christmas 2015-12-25T02:23:18Z zhcy1 joined #scheme 2015-12-25T02:24:22Z pjb: :-) 2015-12-25T02:25:04Z zhcy quit (Ping timeout: 265 seconds) 2015-12-25T02:35:28Z davexunit quit (Quit: Later) 2015-12-25T02:42:11Z cemerick quit (Ping timeout: 264 seconds) 2015-12-25T02:55:55Z emacsomancer joined #scheme 2015-12-25T03:01:24Z DGASAU quit (Remote host closed the connection) 2015-12-25T03:04:42Z Mokuso quit (Quit: δε λες κουβέντα) 2015-12-25T03:06:26Z contrapunctus joined #scheme 2015-12-25T03:31:44Z neoncontrails quit (Remote host closed the connection) 2015-12-25T03:35:46Z neoncontrails joined #scheme 2015-12-25T03:39:08Z Necrosporus: I'm trying to read The Little Schemer but it is filled with tedious descriptions on how programs work while I write them myself easily, like rember. In the book there's even a mistake which I didn't make at first place 2015-12-25T03:41:02Z ArneBab joined #scheme 2015-12-25T03:44:06Z ArneBab_ quit (Ping timeout: 240 seconds) 2015-12-25T03:49:58Z emacsomancer quit (Ping timeout: 250 seconds) 2015-12-25T04:03:51Z neoncontrails quit (Remote host closed the connection) 2015-12-25T04:04:33Z turtleman_ quit (Read error: No route to host) 2015-12-25T04:04:50Z turtleman_ joined #scheme 2015-12-25T04:04:54Z Tbone139: Necrosporus: Not sure whether you've found more info yet, but to my understanding, where lists are modular and composed of 'pairs', a vector occupies a contiguous block of memory and is thus much faster to look up values within (for sufficiently large datasets). The tradeoff is vectors are fixed-width, and modifying them (efficiently) requires non-functional programming 2015-12-25T04:05:54Z Necrosporus: so it's more like traditional arrays 2015-12-25T04:12:12Z pierpa quit (Ping timeout: 272 seconds) 2015-12-25T04:23:39Z turtleman_: there are "functional vectors" which are trees with a vector interface. 2015-12-25T04:23:52Z turtleman_: with the time complexity tradeoff of a tree. 2015-12-25T04:28:25Z turtleman_ quit (Quit: Leaving) 2015-12-25T04:31:29Z jcowan: Necrosporus: Yes, exactly 2015-12-25T04:32:23Z zhcy1 quit (Ping timeout: 255 seconds) 2015-12-25T04:33:25Z daviid` joined #scheme 2015-12-25T04:39:10Z karswell quit (Read error: Connection reset by peer) 2015-12-25T04:40:59Z pjb: Tbone139: in Common Lisp, vectors are not fixed-width. You can adjust arrays. Also, there are vectors with a fill-pointer. 2015-12-25T04:51:41Z zhcy joined #scheme 2015-12-25T04:52:00Z zbigniew_ is now known as zbigniew 2015-12-25T05:11:23Z zhcy quit (Ping timeout: 276 seconds) 2015-12-25T05:17:04Z zhcy joined #scheme 2015-12-25T05:24:09Z Menche quit (Quit: Leaving) 2015-12-25T05:34:18Z zhcy1 joined #scheme 2015-12-25T05:34:37Z nilg joined #scheme 2015-12-25T05:35:46Z zhcy quit (Ping timeout: 240 seconds) 2015-12-25T05:38:26Z zhcy1 quit (Ping timeout: 240 seconds) 2015-12-25T05:38:38Z nilg quit (Read error: Connection reset by peer) 2015-12-25T05:39:17Z zhcy joined #scheme 2015-12-25T05:46:07Z karswell joined #scheme 2015-12-25T06:02:26Z jcowan quit (Quit: Leaving) 2015-12-25T06:05:09Z badkins_ quit (Remote host closed the connection) 2015-12-25T06:17:25Z spew joined #scheme 2015-12-25T06:20:17Z zhcy1 joined #scheme 2015-12-25T06:21:46Z zhcy quit (Ping timeout: 240 seconds) 2015-12-25T06:23:42Z zhcy1 quit (Remote host closed the connection) 2015-12-25T06:24:22Z zhcy joined #scheme 2015-12-25T06:31:53Z Necrosporus: Is there a built in identity function in Scheme or I should invent my own? 2015-12-25T06:32:02Z Necrosporus: rudybot, (identity 'test) 2015-12-25T06:32:02Z rudybot: Necrosporus: ; Value: 'test 2015-12-25T06:32:11Z Necrosporus: rudybot, 'test 2015-12-25T06:32:11Z rudybot: Necrosporus: ; Value: 'test 2015-12-25T06:38:45Z zhcy quit (Remote host closed the connection) 2015-12-25T06:44:01Z pjb: (lambda (x) x) is it. 2015-12-25T06:44:02Z Necrosporus: Are there tacit lambdas? 2015-12-25T06:44:15Z pjb: What do you mean? 2015-12-25T06:44:21Z lambda-11235: Necrosporus: Not in r5rs or r7rs standards. 2015-12-25T06:44:31Z zhcy joined #scheme 2015-12-25T06:44:32Z pjb: ((lambda (x) x) 42) #| --> 42 |# 2015-12-25T06:44:50Z Necrosporus: Like if you want to get (lambda (x) (foo x)) for example, you can replace whole expression with foo 2015-12-25T06:45:02Z pjb: Of course. 2015-12-25T06:45:10Z Necrosporus: What if you want to something more complex? 2015-12-25T06:45:26Z pjb: There's nothing tacit there, you will just evaluate the variable foo, and obtain the function bound to it. 2015-12-25T06:45:39Z Necrosporus: e.g. (lambda (x) (bar (foo x))) 2015-12-25T06:46:01Z Necrosporus: can you write it without using variable x? 2015-12-25T06:46:48Z pjb: (define (compose . funs) (if (null? funs) (lambda (x) x) (lambda (x) ((car fun) ((apply compose (cdr funs)) x))))) (compose bar foo) 2015-12-25T06:46:48Z Necrosporus: Can you do (define foobar (lambda (x) (bar (foo x)))) without using additional variables? 2015-12-25T06:48:16Z spew quit (Quit: merry christmas) 2015-12-25T06:48:17Z Necrosporus: pjb, yeah, but there is nothing built-in? 2015-12-25T06:48:18Z Fare quit (Ping timeout: 255 seconds) 2015-12-25T06:48:25Z Necrosporus: like this compose 2015-12-25T06:48:41Z pjb: No. 2015-12-25T06:49:02Z pjb: This is a programming language. It's made for programmers. 2015-12-25T06:49:06Z Necrosporus: That's sad. J and APL has it in language itself 2015-12-25T06:49:17Z pjb: So what? 2015-12-25T06:49:30Z pjb: You just put it in your library! 2015-12-25T06:49:32Z Necrosporus: You can write really complex functions without using variables at all 2015-12-25T06:49:41Z pjb: scheme is a meta programming programming language. 2015-12-25T06:49:48Z pjb: Of course. 2015-12-25T06:52:00Z lambda-11235: Not to mention very minimal, but compose is in SRFI 41. So many implementations do have it. 2015-12-25T06:52:46Z pjb: Necrosporus: what is the last function you wrote? 2015-12-25T06:52:51Z nilg joined #scheme 2015-12-25T06:54:26Z daviid` quit (Ping timeout: 240 seconds) 2015-12-25T06:54:40Z Necrosporus: rudybot, (define (minsertR new old lat) (if (null? lat) '() ((if (eq? (car lat) old) (lambda (x) (cons old (cons new x))) (lambda (x) (cons (car lat) x))) (minsertR new old (cdr lat))))) 2015-12-25T06:54:41Z rudybot: Necrosporus: Done. 2015-12-25T06:55:35Z Necrosporus: I think that I can put if under lambda (x) 2015-12-25T07:00:54Z Necrosporus: pjb, insert new term after each occurrence of old term into list lat (why "lat"? it's from TLS book) 2015-12-25T07:00:59Z jusss joined #scheme 2015-12-25T07:06:14Z Necrosporus: My version has less tokens than theirs: http://pastebin.com/3XeUfD5u 2015-12-25T07:07:06Z Necrosporus: 36 vs 29 2015-12-25T07:08:06Z Menche joined #scheme 2015-12-25T07:19:23Z nilg quit (Ping timeout: 264 seconds) 2015-12-25T07:20:10Z lambda-11235 quit (Quit: Bye) 2015-12-25T07:23:08Z physixer quit (Quit: leaving) 2015-12-25T07:27:35Z zhcy1 joined #scheme 2015-12-25T07:29:48Z zhcy quit (Ping timeout: 272 seconds) 2015-12-25T07:31:10Z pjb: Necrosporus: why is it not already in scheme? 2015-12-25T07:31:27Z pjb: After all, inserting itesm in lists seems quite a general feature. 2015-12-25T07:32:59Z Necrosporus: pjb, maybe it is, I do not know. I'm going through the book and they probably reimplement features a lot 2015-12-25T07:34:04Z Necrosporus: pjb, also my idea about tcl interpreter is that I define in Tcl as few lisp primitives as possible and then write a standard library to implement the rest 2015-12-25T07:34:21Z pjb: Exactly. 2015-12-25T07:36:16Z jusss: hi there, in full continuation, I can use like this: (call/cc (lambda (k) (k 3))) (display 0), I'd like to say the continuation doesn't must wait for one return value of (call/cc ...), but in delimited continuation, can I do that with shift/reset ? 2015-12-25T07:36:20Z Necrosporus: actually lisp program could be transformed into Tcl if (...) around functions are replaced with [apply $ ... ] and within macros into {} 2015-12-25T07:36:53Z pjb: What about: (define (minsertR new old lat) (if (null? lat) '() (let ((x (minsertR new old (cdr lat)))) (if (eq? (car lat) old) (cons old (cons new x)) (cons (car lat) x))))) 2015-12-25T07:38:00Z jusss: so in delimited continuation, shift must be nested in reset ? am I right ? 2015-12-25T07:39:26Z pjb: Necrosporus: or even: (define (minsertR new old lat) (if (null? lat) '() (let ((x (minsertR new old (cdr lat)))) (cons (car lat) (if (eq? (car lat) old) (cons new x) x))))) 2015-12-25T07:40:40Z pjb: Necrosporus: you should not use eq? Try eqv? instead. 2015-12-25T07:41:21Z alezost joined #scheme 2015-12-25T07:41:35Z pjb: lat is a list of atoms, and 42 is an atom. But (eq? 42 42) can be false. http://www.schemers.org/Documents/Standards/R5RS/HTML/ 2015-12-25T07:41:59Z pjb: http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_idx_216 2015-12-25T07:41:59Z rudybot: http://teensy.info/WuXGqYvvRh 2015-12-25T07:43:40Z Necrosporus: pjb, I dunno, TLS uses eq? 2015-12-25T07:44:25Z Necrosporus: though your version has 29 tokens as well as mine seem 2015-12-25T07:44:43Z pjb: Yes, because they consider only symbols, but in modern lisps, atoms can be also bignums or other things on which eq? doesn't work. 2015-12-25T07:47:11Z zhcy joined #scheme 2015-12-25T07:47:42Z botter joined #scheme 2015-12-25T07:48:48Z zhcy1 quit (Ping timeout: 272 seconds) 2015-12-25T08:05:16Z botter quit (Quit: Page closed) 2015-12-25T08:05:39Z contrapunctus quit (Quit: "bai") 2015-12-25T08:25:11Z carc quit (Quit: QUIT) 2015-12-25T08:26:05Z carc joined #scheme 2015-12-25T08:51:42Z fantazo joined #scheme 2015-12-25T08:59:27Z aap_ is now known as aap 2015-12-25T09:05:07Z ASau` is now known as ASau 2015-12-25T09:22:03Z jusss quit (Quit: ERC (IRC client for Emacs 24.5.1)) 2015-12-25T09:26:49Z Necrosporus: If you have a function, let's say (lambda (mul a b) (* a b)), how do you make it multi-slot like (+) or (*)? Is there currying in lisp? 2015-12-25T09:27:27Z alezost quit (Quit: I live in GuixSD and Emacs ) 2015-12-25T09:27:41Z Necrosporus: In tcl there is special variable args for that 2015-12-25T09:56:45Z zhcy quit (Quit: zhcy) 2015-12-25T10:28:51Z Necrosporus: rudybot, (define (addm . args) (cond ((null? args) 0) ((null? (cdr args)) (car args)) (else (eval (cons 'addm (cdr args)))))) 2015-12-25T10:28:51Z rudybot: Necrosporus: Done. 2015-12-25T10:29:02Z Necrosporus: rudybot, (addm 1) 2015-12-25T10:29:03Z rudybot: Necrosporus: ; Value: 1 2015-12-25T10:29:05Z Necrosporus: rudybot, (addm 5) 2015-12-25T10:29:05Z rudybot: Necrosporus: ; Value: 5 2015-12-25T10:29:08Z Necrosporus: rudybot, (addm ) 2015-12-25T10:29:09Z rudybot: Necrosporus: ; Value: 0 2015-12-25T10:29:12Z Necrosporus: rudybot, (addm 1 2) 2015-12-25T10:29:13Z rudybot: Necrosporus: ; Value: 2 2015-12-25T10:29:16Z Necrosporus: rudybot, (addm 1 2 3) 2015-12-25T10:29:17Z rudybot: Necrosporus: ; Value: 3 2015-12-25T10:30:12Z Necrosporus: rudybot, (define (addm . args) (cond ((null? args) 0) ((null? (cdr args)) (car args)) (else (add (car args) (eval (cons 'addm (cdr args))))))) 2015-12-25T10:30:13Z rudybot: Necrosporus: Done. 2015-12-25T10:30:16Z Necrosporus: rudybot, (addm 1 2 3) 2015-12-25T10:30:16Z rudybot: Necrosporus: error: add: undefined; cannot reference an identifier before its definition in module: 'program 2015-12-25T10:30:26Z Necrosporus: rudybot, (add 2 3) 2015-12-25T10:30:27Z rudybot: Necrosporus: error: add: undefined; cannot reference an identifier before its definition in module: 'program 2015-12-25T10:30:49Z Necrosporus: (define add (lambda (a b) (+ a b))) 2015-12-25T10:31:02Z Necrosporus: rudybot, (define add (lambda (a b) (+ a b))) 2015-12-25T10:31:02Z rudybot: Necrosporus: Done. 2015-12-25T10:31:09Z Necrosporus: rudybot, (addm 2 3) 2015-12-25T10:31:09Z rudybot: Necrosporus: ; Value: 5 2015-12-25T10:31:13Z Necrosporus: rudybot, (addm 2 3 5) 2015-12-25T10:31:13Z rudybot: Necrosporus: ; Value: 10 2015-12-25T10:49:50Z ggole joined #scheme 2015-12-25T11:01:45Z Necrosporus: rudybot, (define (add . args) (define a (lambda (x y) (+ x y))) (cond ((null? args) 0) ((null? (cdr args)) (car args)) (else (a (car args) (eval (cons 'add (cdr args))))))) 2015-12-25T11:01:45Z rudybot: Necrosporus: Done. 2015-12-25T11:01:54Z Necrosporus: rudybot, (add 1 2 3 ) 2015-12-25T11:01:55Z rudybot: Necrosporus: ; Value: 6 2015-12-25T11:02:05Z Necrosporus: rudybot, (add 2 2) 2015-12-25T11:02:05Z rudybot: Necrosporus: ; Value: 4 2015-12-25T11:02:08Z Necrosporus: rudybot, (add 2) 2015-12-25T11:02:08Z rudybot: Necrosporus: ; Value: 2 2015-12-25T11:02:29Z ggole_ joined #scheme 2015-12-25T11:05:58Z ggole quit (Ping timeout: 256 seconds) 2015-12-25T11:06:33Z gravicappa joined #scheme 2015-12-25T11:07:39Z Necrosporus: Why does not it work in guile 1.8? 2015-12-25T11:19:57Z Necrosporus: rudybot, (define (add . args) (define a (lambda (x y) (+ x y))) (if (null? args) 0 (a (car args) (eval (cons 'add (cdr args)))))) 2015-12-25T11:19:58Z rudybot: Necrosporus: Done. 2015-12-25T11:20:09Z Necrosporus: rudybot, (add 4 5 2) 2015-12-25T11:20:09Z rudybot: Necrosporus: ; Value: 11 2015-12-25T11:20:59Z Necrosporus: Is it possible to do it (variadic function) in a simpler way? 2015-12-25T11:23:02Z ggole_: If you have a suitable function over lists, use that on the argument list? 2015-12-25T11:24:01Z ggole_: There's also no need for the binding for a there. 2015-12-25T11:24:05Z Necrosporus: I got it, (eval (cons 'add (cdr args))) is just same thing as (apply add (cdr args)) 2015-12-25T11:24:54Z ggole_: Uh, there's no need for eval here 2015-12-25T11:27:56Z Steverman joined #scheme 2015-12-25T11:36:49Z ASau left #scheme 2015-12-25T11:44:18Z scoofy joined #scheme 2015-12-25T11:44:57Z biubiubiu joined #scheme 2015-12-25T11:45:37Z biubiubiu: what's the different between continuation and delimited continuation ? 2015-12-25T11:54:58Z Necrosporus: rudybot, (define (make_variadic f zero) (lambda args (if (null? args) zero (f (car args) (apply (make_variadic f zero) (cdr args)))))) 2015-12-25T11:54:58Z rudybot: Necrosporus: Done. 2015-12-25T11:55:26Z Necrosporus: rudybot, ((make_variadic (lambda (x y) (* x y)) 1) 1 2 3 4 5 6 7) 2015-12-25T11:55:27Z rudybot: Necrosporus: ; Value: 5040 2015-12-25T11:56:05Z Necrosporus: I wrote this thing, but I do not really understand what it does 2015-12-25T11:57:21Z Necrosporus: Why does it still work if I apply recursion with same (make_variadic f zero) ? 2015-12-25T11:57:39Z Beluki joined #scheme 2015-12-25T11:58:43Z Necrosporus: Is it possible to convert an lambda back into symbolic representation? 2015-12-25T11:59:01Z Beluki: Hi. 2015-12-25T11:59:17Z Beluki: What do you understand by "symbolic representation"? 2015-12-25T11:59:59Z XTL: Like elections? 2015-12-25T12:01:24Z Necrosporus: I mean, for example, I have a higher order function 2015-12-25T12:01:32Z Necrosporus: How do I examine its return value? 2015-12-25T12:01:54Z Necrosporus: I want to see if returned definition matches what I'd expect 2015-12-25T12:03:23Z Beluki: Do you mean getting back the original code? 2015-12-25T12:03:47Z Beluki: > (define (square x) (* x x)) 2015-12-25T12:03:48Z Beluki: > square 2015-12-25T12:03:53Z Beluki: (lambda (x) (* x x)) 2015-12-25T12:03:57Z Beluki: Would that work? 2015-12-25T12:09:02Z Necrosporus: it should 2015-12-25T12:09:11Z Necrosporus: Beluki, yes 2015-12-25T12:09:40Z Beluki: Unfortunately, it's not possible on many implementations (for good reasons). 2015-12-25T12:09:58Z Necrosporus: rudybot, (define multiplicator (make_variadic (lambda (x y) (* x y)) 1)) 2015-12-25T12:09:58Z rudybot: Necrosporus: Done. 2015-12-25T12:10:05Z Necrosporus: rudybot, multiplicator 2015-12-25T12:10:06Z rudybot: Necrosporus: ; Value: # 2015-12-25T12:10:28Z Necrosporus: Beluki, can you please tell me what does your lisp return? 2015-12-25T12:10:49Z Necrosporus: and what interpreter do you use? 2015-12-25T12:10:49Z Beluki: My lisp? I use many different implementations. 2015-12-25T12:11:14Z Necrosporus: One which could give procedure body back 2015-12-25T12:12:00Z Beluki: If I remember correctly, I think Picolisp does give you the body back. 2015-12-25T12:12:09Z Beluki: But then again, picolisp is not scheme. 2015-12-25T12:12:51Z Necrosporus: do you mind to test it on my example? 2015-12-25T12:16:12Z Beluki: I can't right now, not on my computer. 2015-12-25T13:12:04Z oleo_ quit (Quit: Verlassend) 2015-12-25T13:21:57Z oleo joined #scheme 2015-12-25T13:45:34Z davexunit joined #scheme 2015-12-25T14:27:11Z Gmind joined #scheme 2015-12-25T14:27:14Z Gmind left #scheme 2015-12-25T14:33:31Z davexunit quit (Remote host closed the connection) 2015-12-25T14:33:47Z davexunit joined #scheme 2015-12-25T14:58:17Z sz0 joined #scheme 2015-12-25T14:59:20Z nmeum joined #scheme 2015-12-25T15:00:06Z jcowan joined #scheme 2015-12-25T15:04:24Z nmeum quit (Remote host closed the connection) 2015-12-25T15:08:07Z alezost joined #scheme 2015-12-25T15:33:03Z biubiubiu quit (Read error: Connection reset by peer) 2015-12-25T15:34:48Z Beluki quit (Quit: Beluki) 2015-12-25T15:45:04Z nmeum joined #scheme 2015-12-25T15:45:28Z nmeum quit (Client Quit) 2015-12-25T15:45:35Z davexunit quit (Quit: Later) 2015-12-25T15:45:37Z nmeum joined #scheme 2015-12-25T15:45:57Z nmeum quit (Client Quit) 2015-12-25T15:53:34Z nmeum joined #scheme 2015-12-25T16:05:01Z cemerick joined #scheme 2015-12-25T16:22:10Z cemerick quit (Ping timeout: 256 seconds) 2015-12-25T16:24:07Z daviid` joined #scheme 2015-12-25T16:29:10Z wildlander joined #scheme 2015-12-25T16:35:15Z Wojciech_K joined #scheme 2015-12-25T16:37:49Z turtleman_ joined #scheme 2015-12-25T16:43:45Z sz0 left #scheme 2015-12-25T16:47:09Z synthmeat joined #scheme 2015-12-25T16:52:04Z neoncontrails joined #scheme 2015-12-25T16:52:12Z fantazo quit (Ping timeout: 272 seconds) 2015-12-25T16:53:28Z longlong joined #scheme 2015-12-25T16:53:43Z longlong: rudybot: (define a) 2015-12-25T16:53:44Z rudybot: longlong: your sandbox is ready 2015-12-25T16:53:44Z rudybot: longlong: error: eval:1:0: define: bad syntax (missing expression after identifier) in: (define a) 2015-12-25T16:54:03Z longlong: rudybot: (define a 0) 2015-12-25T16:54:03Z rudybot: longlong: Done. 2015-12-25T16:54:05Z longlong: a 2015-12-25T16:54:12Z longlong: rudybot: 0 2015-12-25T16:54:13Z rudybot: longlong: ; Value: 0 2015-12-25T16:54:46Z longlong: (reset (+ 1 (shift k (set! a k)))) 2015-12-25T16:54:58Z neoncontrails quit (Remote host closed the connection) 2015-12-25T16:55:20Z longlong: rudybot: (reset (+ 1 (shift k (set! a k)))) 2015-12-25T16:55:20Z rudybot: longlong: error: reset: undefined; cannot reference an identifier before its definition in module: 'program 2015-12-25T16:55:54Z longlong quit (Client Quit) 2015-12-25T16:56:11Z sz0 joined #scheme 2015-12-25T17:03:05Z lambda-11235 joined #scheme 2015-12-25T17:04:38Z fantazo joined #scheme 2015-12-25T17:34:30Z turtleman_ quit (Quit: Leaving) 2015-12-25T17:42:17Z turbopape joined #scheme 2015-12-25T18:02:44Z turbopape quit (Quit: Quitte) 2015-12-25T18:06:25Z lambda-11235 quit (Quit: Bye) 2015-12-25T18:13:06Z lambda-11235 joined #scheme 2015-12-25T18:13:13Z Tbone139 quit (Quit: Leaving) 2015-12-25T18:15:55Z lambda-11235 quit (Client Quit) 2015-12-25T18:16:38Z lambda-11235 joined #scheme 2015-12-25T18:19:59Z ggole_ quit 2015-12-25T18:23:43Z sz0 quit (Quit: Bye.) 2015-12-25T18:31:13Z Beluki joined #scheme 2015-12-25T18:44:20Z wildlander quit (Ping timeout: 246 seconds) 2015-12-25T18:45:50Z wildlander joined #scheme 2015-12-25T19:13:38Z jcowan quit (Read error: Connection reset by peer) 2015-12-25T19:24:54Z daviid` quit (Ping timeout: 265 seconds) 2015-12-25T19:53:20Z fantazo quit (Ping timeout: 260 seconds) 2015-12-25T20:00:43Z jyc quit (Ping timeout: 250 seconds) 2015-12-25T20:01:04Z GGMethos quit (Ping timeout: 250 seconds) 2015-12-25T20:08:51Z lambda-11235 quit (Quit: Bye) 2015-12-25T20:16:10Z fantazo joined #scheme 2015-12-25T20:37:40Z Wojciech_K quit (Quit: Leaving) 2015-12-25T20:40:07Z sz0 joined #scheme 2015-12-25T20:40:40Z jyc joined #scheme 2015-12-25T20:40:56Z dTal_ quit (Ping timeout: 250 seconds) 2015-12-25T20:42:07Z pierpa joined #scheme 2015-12-25T20:47:53Z GGMethos joined #scheme 2015-12-25T20:52:25Z badkins joined #scheme 2015-12-25T21:11:13Z ec\ is now known as ec 2015-12-25T21:13:57Z Fare joined #scheme 2015-12-25T21:22:12Z badkins quit (Remote host closed the connection) 2015-12-25T21:23:27Z h0wl3vvd joined #scheme 2015-12-25T21:23:30Z h0wl3vvd: hello 2015-12-25T21:23:34Z h0wl3vvd: is exist any profiler for scheme ? 2015-12-25T21:24:46Z gravicappa quit (Ping timeout: 240 seconds) 2015-12-25T21:37:57Z Fare quit (Ping timeout: 255 seconds) 2015-12-25T21:42:40Z Necrosporus_ joined #scheme 2015-12-25T21:45:44Z Necrosporus quit (Ping timeout: 256 seconds) 2015-12-25T21:47:41Z Fare joined #scheme 2015-12-25T21:52:52Z physixer joined #scheme 2015-12-25T21:56:58Z alezost quit (Quit: I live in GuixSD and Emacs ) 2015-12-25T21:59:46Z pjb: h0wl3vvd: probably; but I don't know them. In anycase, it will be very implementation dependant. Check the doc of your scheme implementation. 2015-12-25T22:01:32Z nilg joined #scheme 2015-12-25T22:11:55Z Fare quit (Ping timeout: 260 seconds) 2015-12-25T22:23:56Z Fare joined #scheme 2015-12-25T22:33:24Z Fare quit (Ping timeout: 265 seconds) 2015-12-25T22:36:03Z Fare joined #scheme 2015-12-25T22:53:50Z tessier quit (Ping timeout: 272 seconds) 2015-12-25T22:54:06Z tessier joined #scheme 2015-12-25T23:10:54Z Necrosporus_ is now known as Necrosporus 2015-12-25T23:11:35Z Fare quit (Ping timeout: 265 seconds) 2015-12-25T23:19:06Z h0wl3vvd quit (Read error: Connection reset by peer) 2015-12-25T23:23:24Z physixer: is it allowed to setup cond such that multiple condition expressions match? I guess it would be useless because the result of first matching expression will be used. 2015-12-25T23:24:05Z nilg quit (Remote host closed the connection) 2015-12-25T23:33:42Z Necrosporus: physixer, use Iand)? 2015-12-25T23:33:45Z Necrosporus: physixer, use (and)? 2015-12-25T23:35:48Z physixer: ok 2015-12-25T23:36:57Z physixer: I'm reading HtDP2e ch4 and it introduces define-struct. So (define-struct position [x y]) creates functions make-position, position-x, position-y, position?. How does it do that? 2015-12-25T23:38:00Z physixer: I asked yesterday on #lisp how I can use one function to define two things, e.g., (define-two a 5 b 8) but they said it's not easy. But define-struct does something very similar. 2015-12-25T23:40:13Z wasamasa: unhygienic macros probably 2015-12-25T23:47:25Z cemerick joined #scheme 2015-12-25T23:49:06Z nilg joined #scheme