00:26:32 -!- sebbu has quit ("@+"). 00:27:09 * pikhq is ready, but leaves soon 00:35:57 -!- nazgjunk has quit ("Bi-la Kaifa"). 00:50:08 -!- nazgjunk has joined. 02:03:23 -!- oerjan has joined. 02:10:16 Tweek888: do root <- replicate 3 6; show root 02:13:36 or possibly, let evil = sex; sex = 6 in do root <- replicate 3 evil; show evil 02:22:08 oerjan: for a while, I thought you were looking for IO actions. 02:22:19 Then I realized that both of those produce "666". 02:22:31 :) 02:22:44 do evil <- [sex]; sex <- [6]; root <- replicate 3 evil; show root 02:23:03 Or show evil. I think they do the same thing. 02:23:09 Or show 6, or show sex. 02:23:21 that definitely does not work with do. maybe mdo. 02:23:38 indeed 02:24:26 ...Indeed, that doesn't work with do. 02:24:38 do sex <- [6]; evil <- [sex]; root <- replicate 3 evil; show root 02:24:58 mdo putStr x; x <- getLine 02:25:04 mdo worked fine though. the wonders of recursive monads. 02:25:12 The latter just for fun. 02:25:44 alas, that will probably give a run time error. 02:26:00 unless you are importing the Control.Time module. 02:26:08 :-) 02:26:14 Runtime error, eh? 02:27:08 dc is so cool 02:27:17 Haskell's so smart! Or something like that, anyway. 02:27:28 oh right, there needs to be a result expression at the end. 02:27:43 mdo putStr x; x <- getLine; return x 02:28:06 and that indeed gives a runtime error. 02:29:31 What does it give? 02:30:07 in hugs, <>, the usual error for using a value that is currently under evaluation 02:30:28 $_ 02:31:05 is that dc or perl? 02:32:05 neither 02:32:14 it's two characters 02:32:38 it does happen to be the usual perl default variable 02:32:46 Default variable? 02:32:58 pronoun 02:33:16 So what's it refer to? 02:33:22 it 02:33:37 Whatever was last referred to? 02:33:41 like if you do print with no arguments, $_ is printed, similarly for substitutions and many other things 02:34:04 the default loop variable, the arguments to a function 02:34:11 no, it is an ordinary variable but the default for many commands if you don't specify any 02:34:43 it is not the default for everything though 02:35:55 for example, while (<>) is an abbreviation for while ($_=), i think, using two different defaults in on command 02:36:25 perl is horrid 02:37:18 I'm beginning to agree. 02:41:00 (actually, while (defined ($_=)) 02:41:12 What? 02:41:45 the result test is whether the value is defined, not whether it is true 02:42:33 The horror. 02:42:35 presumably so you don't get tripped up by empty strings, which are defined but false 02:42:51 You can get an empty string out of =? 02:43:13 = returns what it assigned (i assume_ 02:43:21 s/_/)/ 02:43:31 It's an assignment operator? 02:43:36 yes. 02:43:51 And returns what it's defined... the horror. 02:44:01 horror? 02:44:05 that is borrowed from C actually 02:44:15 yeah, and it's handy 02:44:36 Indeed: horrible yet handy. 02:44:39 a = b = c 02:45:01 while (<>) reads the next line from the files on the command line, assigning it to $_ and entering the loop if there was any. 02:45:59 it is so common that you can put around your whole program by giving perl the -n option. 02:46:21 -p adds a print command inside, making perl behave almost like sed. 02:47:02 basically perl generally tries to use defaults to make the most common case shorter. 02:47:35 *it 02:48:28 similarly with substitutions, that uses $_ as default and that too makes perl behave almost like sed. 02:59:34 sed+awk > perl 03:06:12 oerjan: adds a print command where? 03:08:24 har har, the RSA-in-4-lines-perl needs to call dc 03:14:06 (sorry, away from window) 03:14:28 bsmntbombdood: dc? 03:14:28 just before the end of the loop i think 03:15:00 so whatever is in $_ is printed out before reading the next line into it 03:15:00 Now, how about this "indent style": use as little whitespace as possible. 03:15:35 i see we are still on horrible subjects :) 03:15:37 ihope: turing complete rpn calculator language 03:16:16 i would assume that perl contains essentially everything in sed+awk. 03:16:32 given that those were probably its main ancestors. 03:17:21 yes, but it's massivly uglier 03:17:25 i don't know awk much though 03:17:29 if it's not broke don't fix it 03:17:55 perl has its philosophy, elegance is not in it. 03:18:18 but practicality definitely is 03:19:23 module Main where{main=do{num<-readLine;print(isPrime num)};isPrime num=all[not(num`mod`n==0)|n<-[2..num-1]]} 03:19:42 One-line Haskell is a lot easier than one-line Python. 03:20:28 if the goal is _not_ to avoid whitespace, then you can usually strip some {} even in one-line Haskell. 03:21:06 that dreaded (by compiler writers) parse-error } insertion rule ensures that. 03:21:30 Parse-error } insertion rule? 03:21:38 If it doesn't look right, add a }? 03:21:45 exactly :) 03:22:20 or rather, an invisible } matching an invisible { 03:22:28 There's probably a good reason 'let {x = 3 in x' fails, then. 03:22:51 indeed it needs to be let x = 3 in x 03:23:10 because the implicit } can only match an implicit { 03:24:26 Doesn't sound too hard. 03:24:44 with let ... in it usually works nicely since the in basically forces the } cleanly 03:24:48 And since I feel like being a little random, I wrote this: http://pastebin.ca/463717 03:25:38 but if you try to nest where and do like in your example, you probably need at least one set of explicit {} 03:26:46 btw the rule is dreaded by compiler writers because it forces the parser to give information back to the lexer. 03:27:59 what language is that? 03:29:16 I don't know if it has a name. 03:29:19 some robot programming language? 03:29:24 Sort of. 03:29:29 It's for RigidChips. 03:30:38 My... construction is pretty nice, in my obviously not that humble opinion. 03:31:06 ic. thank god for wikipedia, because all the other links were japanese. 03:31:45 Actually, it's nice except for what happens when you try to move both forward/backward and sideways. 03:32:13 wikipedia's handling of case in titles bugs me 03:32:30 The whole thing flattens out and makes a lot of dust. 03:33:08 then wiktionary should drive you insane :) 03:33:26 (there the first character counts too) 03:33:51 what, it explodes? :D 03:34:45 there is dust in RigidChips? I thought it was about pure physics 03:36:15 Eh, it's just to look cool. It doesn't do anything. 04:02:56 wooo. C preprocessor hacks are oddly fun. 04:59:33 -!- CakeProphet has quit ("haaaaaaaaaa"). 05:15:15 -!- CakeProphet has joined. 06:00:35 -!- Sgeo has quit ("Ex-Chat"). 06:13:14 -!- ihope has quit (Connection timed out). 07:26:09 -!- calamari has joined. 07:58:51 -!- calamari has quit ("Leaving"). 07:59:59 -!- clog has quit (ended). 08:00:00 -!- clog has joined. 08:48:26 -!- oerjan has quit ("leaving"). 08:57:58 -!- sebbu has joined. 09:05:56 * sebbu cherche supernatural saison 1 episode 15 version lol ou sous titre version proper xor ou saints 09:10:28 -!- sebbu2 has joined. 09:12:27 -!- sebbu3 has joined. 09:13:03 -!- sebbu has quit (Nick collision from services.). 09:13:05 -!- sebbu2 has quit (Nick collision from services.). 09:13:13 -!- sebbu3 has changed nick to sebbu. 09:50:15 -!- sebbu2 has joined. 10:09:23 -!- sebbu has quit (Read error: 110 (Connection timed out)). 10:18:54 -!- sebbu has joined. 10:37:30 -!- sebbu2 has quit (Read error: 110 (Connection timed out)). 11:06:26 -!- jix__ has joined. 11:44:26 -!- ihope has joined. 13:55:54 -!- nazgjunk has quit ("Bi-la Kaifa"). 14:18:11 -!- nazgjunk has joined. 14:30:21 -!- ihope_ has joined. 14:40:00 -!- ihope has quit (Read error: 110 (Connection timed out)). 15:21:27 sebbu: ?? 15:22:08 it's good, i found it 16:14:36 -!- yachi has joined. 16:29:01 -!- oerjan has joined. 16:45:55 -!- zzoldan has joined. 16:46:06 what is this thing for anyways? 16:46:19 -!- zzoldan has quit. 17:31:43 -!- oerjan has quit ("leaving"). 17:57:35 -!- CakeProphet has quit ("haaaaaaaaaa"). 18:01:02 -!- Sgeo has joined. 18:05:44 * SimonRC goes to dinner 18:42:07 -!- ihope_ has quit ("http://tunes.org/~nef/logs/esoteric/06.08.09"). 19:09:52 -!- yachi has quit (Remote closed the connection). 19:36:14 no one is writing fibonacci programs 19:36:19 -!- ihope has joined. 19:36:46 So it's "the prophet wizard of the crayon cake and the seven inch bread"? 20:21:31 -!- CakeProphet has joined. 21:20:56 -!- Rugxulo has joined. 21:28:14 -!- Rugxulo has left (?). 21:50:26 -!- UnrelatedToQaz has joined. 21:51:14 Excuse my incompetence. 21:51:23 !bf ++++++++++[->+>+<<] 21:51:25 >>[-<<+>>] 21:51:26 <+++++++++++++++++++++++++++++++++++++++++++++++ 21:51:28 <[>.-<-] 21:51:38 Not quite. 21:51:48 Your incompetence is excused. 21:51:54 What are you trying to do? 21:52:04 (btw, Egobot isn't running, so !bf won't do jack) 21:52:12 Yes, I only just noticed that. 21:52:33 !insert rand(Expression_Of_Annoyance) 22:11:04 -!- jix__ has quit (Read error: 110 (Connection timed out)). 22:11:31 -!- jix__ has joined. 22:11:32 * pikhq sighs 22:12:18 ? 22:12:49 Just tired. 22:24:29 -!- UnrelatedToQaz has left (?). 22:35:17 how was prom? 22:36:04 -!- Jakevfr has joined. 22:36:43 -!- Jakevfr has quit (Client Quit). 22:42:06 $ echo "abc=2; (abc+2)*4"|./a.out | dc 22:42:08 16 22:42:11 it works! 23:03:11 -!- jix__ has quit ("Bitte waehlen Sie eine Beerdigungnachricht"). 23:07:16 Went wonderfully. 23:07:35 Writing an infix->RPN program? 23:08:59 yeah 23:11:20 -!- oklopol has quit (Read error: 110 (Connection timed out)). 23:13:51 -!- ihope has quit ("http://tunes.org/~nef/logs/esoteric/06.08.09"). 23:22:53 * SimonRC boggles at what "dillogimp" has posted on comp.lang.scheme. 23:23:00 he wanted there to exist a value which would do stuff like: (list 1 2 3 4 5 6) ===> (1 2 3 4 5 6) 23:23:27 The general tone of the responses was as if he had suggested a gay pope: not abusive, but of the complete opinion that the idea was awful and heretical. 23:23:54 It would break invariants like (eq? foo (car (cons foo bar))) and (eq? bar (cdr (cons foo bar))) 23:25:07 = blank 23:26:25 easy 23:29:18 no, he wanted an actual value that you could put in variables and stuff 23:29:56 -!- sebbu has quit ("@+"). 23:31:12 I attempted to explain some concrete reasons why this was a crap idea. Most of the other people were just reacting instinctively -- programers have instincts for programming that tell them this sort of thing is a bad idea, even if they don't know exactly why. 23:32:28 jeez 23:32:55 -!- ihope has joined. 23:33:57 i wonder what he wants it for 23:36:10 oh, haha 23:36:18 he just wants 0