←2007-04-28 2007-04-29 2007-04-30→ ↑2007 ↑all
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 <oerjan> Tweek888: do root <- replicate 3 6; show root
02:13:36 <oerjan> or possibly, let evil = sex; sex = 6 in do root <- replicate 3 evil; show evil
02:22:08 <ihope> oerjan: for a while, I thought you were looking for IO actions.
02:22:19 <ihope> Then I realized that both of those produce "666".
02:22:31 <oerjan> :)
02:22:44 <ihope> do evil <- [sex]; sex <- [6]; root <- replicate 3 evil; show root
02:23:03 <ihope> Or show evil. I think they do the same thing.
02:23:09 <ihope> Or show 6, or show sex.
02:23:21 <oerjan> that definitely does not work with do. maybe mdo.
02:23:38 <oerjan> indeed
02:24:26 <ihope> ...Indeed, that doesn't work with do.
02:24:38 <ihope> do sex <- [6]; evil <- [sex]; root <- replicate 3 evil; show root
02:24:58 <ihope> mdo putStr x; x <- getLine
02:25:04 <oerjan> mdo worked fine though. the wonders of recursive monads.
02:25:12 <ihope> The latter just for fun.
02:25:44 <oerjan> alas, that will probably give a run time error.
02:26:00 <oerjan> unless you are importing the Control.Time module.
02:26:08 <ihope> :-)
02:26:14 <ihope> Runtime error, eh?
02:27:08 <bsmntbombdood> dc is so cool
02:27:17 <ihope> Haskell's so smart! Or something like that, anyway.
02:27:28 <oerjan> oh right, there needs to be a result expression at the end.
02:27:43 <ihope> mdo putStr x; x <- getLine; return x
02:28:06 <oerjan> and that indeed gives a runtime error.
02:29:31 <ihope> What does it give?
02:30:07 <oerjan> in hugs, <<loop>>, the usual error for using a value that is currently under evaluation
02:30:28 <bsmntbombdood> $_
02:31:05 <oerjan> is that dc or perl?
02:32:05 <bsmntbombdood> neither
02:32:14 <bsmntbombdood> it's two characters
02:32:38 <oerjan> it does happen to be the usual perl default variable
02:32:46 <ihope> Default variable?
02:32:58 <bsmntbombdood> pronoun
02:33:16 <ihope> So what's it refer to?
02:33:22 <bsmntbombdood> it
02:33:37 <ihope> Whatever was last referred to?
02:33:41 <oerjan> like if you do print with no arguments, $_ is printed, similarly for substitutions and many other things
02:34:04 <bsmntbombdood> the default loop variable, the arguments to a function
02:34:11 <oerjan> no, it is an ordinary variable but the default for many commands if you don't specify any
02:34:43 <oerjan> it is not the default for everything though
02:35:55 <oerjan> for example, while (<>) is an abbreviation for while ($_=<ARGV>), i think, using two different defaults in on command
02:36:25 <bsmntbombdood> perl is horrid
02:37:18 <ihope> I'm beginning to agree.
02:41:00 <oerjan> (actually, while (defined ($_=<ARGV>))
02:41:12 <ihope> What?
02:41:45 <oerjan> the result test is whether the value is defined, not whether it is true
02:42:33 <ihope> The horror.
02:42:35 <oerjan> presumably so you don't get tripped up by empty strings, which are defined but false
02:42:51 <ihope> You can get an empty string out of =?
02:43:13 <bsmntbombdood> = returns what it assigned (i assume_
02:43:21 <bsmntbombdood> s/_/)/
02:43:31 <ihope> It's an assignment operator?
02:43:36 <oerjan> yes.
02:43:51 <ihope> And returns what it's defined... the horror.
02:44:01 <bsmntbombdood> horror?
02:44:05 <oerjan> that is borrowed from C actually
02:44:15 <bsmntbombdood> yeah, and it's handy
02:44:36 <ihope> Indeed: horrible yet handy.
02:44:39 <ihope> a = b = c
02:45:01 <oerjan> 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 <oerjan> it is so common that you can put around your whole program by giving perl the -n option.
02:46:21 <oerjan> -p adds a print command inside, making perl behave almost like sed.
02:47:02 <oerjan> basically perl generally tries to use defaults to make the most common case shorter.
02:47:35 <oerjan> *it
02:48:28 <oerjan> similarly with substitutions, that uses $_ as default and that too makes perl behave almost like sed.
02:59:34 <bsmntbombdood> sed+awk > perl
03:06:12 <ihope> oerjan: adds a print command where?
03:08:24 <bsmntbombdood> har har, the RSA-in-4-lines-perl needs to call dc
03:14:06 <oerjan> (sorry, away from window)
03:14:28 <ihope> bsmntbombdood: dc?
03:14:28 <oerjan> just before the end of the loop i think
03:15:00 <oerjan> so whatever is in $_ is printed out before reading the next line into it
03:15:00 <ihope> Now, how about this "indent style": use as little whitespace as possible.
03:15:35 <oerjan> i see we are still on horrible subjects :)
03:15:37 <bsmntbombdood> ihope: turing complete rpn calculator language
03:16:16 <oerjan> i would assume that perl contains essentially everything in sed+awk.
03:16:32 <oerjan> given that those were probably its main ancestors.
03:17:21 <bsmntbombdood> yes, but it's massivly uglier
03:17:25 <oerjan> i don't know awk much though
03:17:29 <bsmntbombdood> if it's not broke don't fix it
03:17:55 <oerjan> perl has its philosophy, elegance is not in it.
03:18:18 <oerjan> but practicality definitely is
03:19:23 <ihope> 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 <ihope> One-line Haskell is a lot easier than one-line Python.
03:20:28 <oerjan> if the goal is _not_ to avoid whitespace, then you can usually strip some {} even in one-line Haskell.
03:21:06 <oerjan> that dreaded (by compiler writers) parse-error } insertion rule ensures that.
03:21:30 <ihope> Parse-error } insertion rule?
03:21:38 <ihope> If it doesn't look right, add a }?
03:21:45 <oerjan> exactly :)
03:22:20 <oerjan> or rather, an invisible } matching an invisible {
03:22:28 <ihope> There's probably a good reason 'let {x = 3 in x' fails, then.
03:22:51 <oerjan> indeed it needs to be let x = 3 in x
03:23:10 <oerjan> because the implicit } can only match an implicit {
03:24:26 <ihope> Doesn't sound too hard.
03:24:44 <oerjan> with let ... in it usually works nicely since the in basically forces the } cleanly
03:24:48 <ihope> And since I feel like being a little random, I wrote this: http://pastebin.ca/463717
03:25:38 <oerjan> 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 <oerjan> btw the rule is dreaded by compiler writers because it forces the parser to give information back to the lexer.
03:27:59 <oerjan> what language is that?
03:29:16 <ihope> I don't know if it has a name.
03:29:19 <oerjan> some robot programming language?
03:29:24 <ihope> Sort of.
03:29:29 <ihope> It's for RigidChips.
03:30:38 <ihope> My... construction is pretty nice, in my obviously not that humble opinion.
03:31:06 <oerjan> ic. thank god for wikipedia, because all the other links were japanese.
03:31:45 <ihope> Actually, it's nice except for what happens when you try to move both forward/backward and sideways.
03:32:13 <bsmntbombdood> wikipedia's handling of case in titles bugs me
03:32:30 <ihope> The whole thing flattens out and makes a lot of dust.
03:33:08 <oerjan> then wiktionary should drive you insane :)
03:33:26 <oerjan> (there the first character counts too)
03:33:51 <oerjan> what, it explodes? :D
03:34:45 <oerjan> there is dust in RigidChips? I thought it was about pure physics
03:36:15 <ihope> Eh, it's just to look cool. It doesn't do anything.
04:02:56 <CakeProphet> 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 <SimonRC> sebbu: ??
15:22:08 <sebbu> 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 <zzoldan> 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 <bsmntbombdood> no one is writing fibonacci programs
19:36:19 -!- ihope has joined.
19:36:46 <ihope> 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 <UnrelatedToQaz> Excuse my incompetence.
21:51:23 <UnrelatedToQaz> !bf ++++++++++[->+>+<<]
21:51:25 <UnrelatedToQaz> >>[-<<+>>]
21:51:26 <UnrelatedToQaz> <+++++++++++++++++++++++++++++++++++++++++++++++
21:51:28 <UnrelatedToQaz> <[>.-<-]
21:51:38 <UnrelatedToQaz> Not quite.
21:51:48 <pikhq> Your incompetence is excused.
21:51:54 <pikhq> What are you trying to do?
21:52:04 <pikhq> (btw, Egobot isn't running, so !bf won't do jack)
21:52:12 <UnrelatedToQaz> Yes, I only just noticed that.
21:52:33 <UnrelatedToQaz> !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 <GregorR> ?
22:12:49 <pikhq> Just tired.
22:24:29 -!- UnrelatedToQaz has left (?).
22:35:17 <bsmntbombdood> how was prom?
22:36:04 -!- Jakevfr has joined.
22:36:43 -!- Jakevfr has quit (Client Quit).
22:42:06 <bsmntbombdood> $ echo "abc=2; (abc+2)*4"|./a.out | dc
22:42:08 <bsmntbombdood> 16
22:42:11 <bsmntbombdood> it works!
23:03:11 -!- jix__ has quit ("Bitte waehlen Sie eine Beerdigungnachricht").
23:07:16 <pikhq> Went wonderfully.
23:07:35 <pikhq> Writing an infix->RPN program?
23:08:59 <bsmntbombdood> 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 <SimonRC> he wanted there to exist a value <nothing> which would do stuff like: (list 1 2 3 <nothing> 4 5 6) ===> (1 2 3 4 5 6)
23:23:27 <SimonRC> 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 <SimonRC> It would break invariants like (eq? foo (car (cons foo bar))) and (eq? bar (cdr (cons foo bar)))
23:25:07 <bsmntbombdood> <nothing> = blank
23:26:25 <bsmntbombdood> easy
23:29:18 <SimonRC> no, he wanted an actual value that you could put in variables and stuff
23:29:56 -!- sebbu has quit ("@+").
23:31:12 <SimonRC> 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 <bsmntbombdood> jeez
23:32:55 -!- ihope has joined.
23:33:57 <bsmntbombdood> i wonder what he wants it for
23:36:10 <bsmntbombdood> oh, haha
23:36:18 <bsmntbombdood> he just wants 0
←2007-04-28 2007-04-29 2007-04-30→ ↑2007 ↑all