00:21:58 -!- CakeProphet has changed nick to SevenInchBread. 01:19:54 SevenInchBread! 01:24:01 -!- nazgjunk has quit (Remote closed the connection). 01:40:31 -!- pikhq has joined. 01:48:45 Gah! Darn Google Groups. 01:52:04 Luckily enough, I can get this down in three sentences. 01:52:22 pikhq: Do you think I should remove the special scope-reassignment of functions with assignment in Plof? 01:52:50 pikhq: It occurs to me that I'm not actually using function reassignment much, and it may be more confusing than it's worth. 01:52:53 Hmm. 01:53:05 Given that I didn't know that was *there*. . . 01:53:09 Haw 01:53:12 The idea is this: 01:53:36 var someObject = :[ /* content */ ]; someObject.newFunction = :{ /* this function will run in someObject's scope, not this one */ }; 01:54:00 Oh. 01:54:15 Um, that's actually useful. 01:54:18 Unfortunately, the side effect is that I can't do things like: 01:54:27 It might be nice to use a different syntax, though. 01:54:30 var a = (x as function):{ var x2 = x; x2(); }; 01:54:49 (As x2 would have a different scope than x was intended to be called in) 01:55:04 var someObject = someObject : :[newFunction = :{ /* Here's your function. */ }]; 01:55:16 Err. 01:55:21 Remove the var bit. 01:55:40 That would have the same effect, but would change someObject, which would be bad if you had child objects of it. 01:56:43 Hrm. 01:57:06 See the dilemma? :) 01:57:11 Yeah.\ 01:58:10 someObject.newFunction = someObject.:{};? 01:58:26 Hmmmmmmmmmmmmmmm 01:58:37 Explicitly specifying the scope of an object at definition time. 01:58:47 Yeah. It *may* work. 02:01:17 Doesn't parse very cleanly with that syntax, but that's solvable. 02:01:42 It's a matter of getting a parsable syntax for it, after all. . . 02:02:07 Just needs more colons ;) 02:02:30 someObject.newFunction = someObject:::{...}; 02:02:31 :P 02:02:38 Hahah. 02:02:42 Overkill, no? 02:15:45 GregorR, hmmm.. so what's the problem now? 02:16:04 SevenInchBread: Just syntax. 02:17:17 well... it's pretty clear what it does.. 02:17:33 assigns a function to a variable in a different scope... 02:18:11 someObject.:{}; is difficult to parse as it is, since '.' and '{' are at the same precedence. 02:18:29 Trying to figure out what to change to get syntax something like that without making parsing any more complex. 02:18:32 no I mean obj.func = :{blah} 02:18:36 OH 02:18:39 The problem there is this: 02:18:48 var a = (x as function):{ var x2 = x; x2(); }; 02:19:14 ...what's that do? 02:19:23 That's the question ;) 02:19:32 * SevenInchBread isn't familiar with the syntax. 02:19:32 Ideally, x2() would be the same as x(). 02:19:48 Well, the problem is that that would reassign the scope. 02:19:59 But in that case, you don't want to reassign the scope. 02:20:02 hmmm... well.... what kind of scoping is it? global-by-default? 02:20:15 Is ... what? 02:20:28 I mean.... in what scope is x2 02:20:45 By the current convention, x is in the scope that it was defined, and x2 is in the scope of function a. 02:20:58 ah okay... Pythonesque? 02:21:17 ....... not really :P 02:21:30 well... variables are implicitly local, or am I wrong? 02:21:46 They have the scope in which they were defined. 02:21:54 ah 02:22:07 I forget that we DECLARE our variables here. :) 02:23:57 hmm.... if you have a direct reference to the object... would it be much of a problem what scope you're in? 02:24:10 * SevenInchBread might be misinterpreting the semantics... but eh. 02:25:41 If you want to make a function be in a prototype object, the function as-declared will not have a direct reference to the object upon which it is run. 02:26:29 ah.... I see.... so you need a sort of implicit way to add members/attributes/whatever to the prototype. 02:26:40 Exactly. 02:26:50 Currently, that's easy because the scope will be reassigned. 02:26:57 But it causes problems elsewhere. 02:27:53 ....could go with a good ol' self 02:28:26 self being the scope from which the function was accessed.... maybe? 02:29:09 Umm, if I call someObject.foo(), I'm calling it from a scope which would not be an appropriate 'self' ... 02:29:21 makes swapping methods between objects easier.... since self always refers to the containing scope for that function. 02:29:43 no I mean.... make self implicitly the object from which foo was accessed 02:29:50 in that case... it would be someObject. 02:30:00 .....not sure how you would program that to make sense though 02:30:30 I'm not sure if that solves the base problem :P 02:30:52 heh, NOT SURE I KNOW THE BASE PROBLEM :) 02:31:49 var a = (x as function):{ var x2 = x; x2(); }; // as Plof is currently designed, this is useless, and worse, an equivalent can't be easily defined. 02:32:18 ...I don't understand the syntax... what's the colon for? 02:32:35 Don't worry about that, just know that it's a function accepting a function as an argument. 02:33:26 oh... that's what's going on? 02:33:58 It's then assigning that function to its own variable, x2. But by the current definition, that changes the scope in which x2 will be run, so x2 won't work (as expected). 02:34:30 But the alternative makes adding functions to prototypes not work well. 02:34:45 so the problem sems to be.... you have a fairly simple way to designate where variables are READ... but not a clear way ro specify where they're WRITTEN. 02:35:16 ............................. what? 02:36:09 >.> wait... doesn't declarations fix that? 02:37:00 -!- ihope has quit (Read error: 110 (Connection timed out)). 02:37:05 just find where the variable is declare... and that's the scope to assign it to? 02:37:07 I don't think the problem that you think is the problem is the problem X-P 02:37:21 That's what's done right now. 02:37:21 yeah.... the colon thing is probably throwing me off. 02:37:45 ............................. OK, so I'll remove the colon, it's functionally equivalent :P 02:37:54 var a = (x as function){ var x2 = x; x2(); }; 02:37:59 .....but what does it DO god damnit 02:38:05 I'm still not sure what that does. 02:38:12 It's irrelevant what it does in this case X_X 02:38:24 I don't want to add to the confusion of trying to discuss a totally unrelated problem. 02:38:41 >.> if I don't get the syntax... I can't decipher what's going on... 02:39:01 that example means nothing to me right now 02:39:11 There are no colons in that example! :P 02:39:30 Is it "the colon thing" you don't understand, or the syntax in general? 02:40:18 .......the whole thing, apparently. 02:40:27 I figured out the colon thing... thin and thick functions right? 02:40:58 ....now I just don't know what that means... you've defined an anonymous function next to a type casted function? 02:41:35 ah wait.... do function calls require parenthesis? If not.... then you're calling (x as function) with {stuff} as the only argument, yes? 02:42:04 um, i think he is defining a function with one argument, x 02:42:13 * GregorR reappears. 02:42:20 Like oerjan said. 02:42:42 OH 02:42:44 okay. 02:42:53 the (x as function) is part of the signature. 02:42:56 Yes. 02:43:06 I thought it was... something being evaluated just before the lambda. 02:43:23 SENSE HAS BEEN MADE 02:43:27 Heh 02:43:55 As it is, when I assign x to x2, x2 gets the content of the function, but the scope when called will be different. 02:44:13 aaah.... dynamic scoping? 02:44:41 Yeah. And it was necessary for me to do that for adding functions to objects to work properly. 02:44:41 this is bizarre. 02:44:46 But it has a nasty side-effect :( 02:45:06 is it possible to have lexical functions and dynamic functions? 02:45:15 or have lexical variables and dynamic variables perhaps? 02:45:21 a language without lexical scoping is not Properly Functional (TM) 02:45:43 well... it does... you can define var in function. 02:45:50 ah... I see the problem. 02:46:04 the variables that are undefined in the function are... basically dynamically gotten. 02:46:10 The default scope of a function is the scope in which it was defined, e.g. lexical scoping. 02:46:20 But, as a functional language, Plof is Ridiculously Impure (TM). 02:46:21 the problem is how to refer to variables of the current object. 02:46:33 Yuh 02:46:44 and something self-like might be cleaner. 02:46:53 ....haha, that's what I suggested once. 02:47:03 yeah, i was repeating 02:47:15 /Getting/ self would be nasty at best. 02:47:20 (For the interpreter) 02:47:33 I think having lexically defined or dynamically defined variables would be interesting. 02:47:43 the python solution seems to work well. 02:48:01 not sure if it would work well in plof 02:48:07 and... it has its problems. 02:48:10 It's not really comparable. 02:48:14 i don't necessarily mean all of it. 02:48:33 just the part about binding functions to methods with the x.f construction 02:48:37 like... you can't assign arbitrary functions to a Python object and expect them to work like methods. 02:49:08 which is something that is done a lot in plof 02:49:11 well, you can do it to a class 02:49:21 Plof has no classes. 02:49:48 yeah... wouldn't work out well..... hmmm... how does IO fix this dilemma? 02:49:52 i suppose the problem is you might want to access unbound methods too 02:50:50 a function that doesn't access self is effectively unbound 02:51:05 ok, simply have an assignment that tags a function as a method. 02:51:41 e.g., an assignment operator which changes scope. 02:51:52 eh.... for some reason it doesn't sound necessarily. 02:52:06 not all of the scope just the self 02:52:06 like there's a really simple way to just make it all work with one assignment operator. 02:52:40 couldn't all assignments with functions treat functions as methods? 02:53:03 oerjan: As it is, functions defined within an object have a parent scope of the object, and so 'self' is unnecessary. It would be confusing for adjunct methods to require 'self', but internal methods not to. Also, it would mean you couldn't copy a method from one object to another. 02:53:14 ....that's basically what Ruby does... a function is a method that simply never refers to self. 02:54:01 hmmm... you do an explicit self. 02:54:08 *could 02:54:17 i know, but i think it would be problematic in any case. what if you copy to an object that has a different set of fields, some of which have the same name as globals? 02:54:19 but... meh... 02:54:35 I suppose I may have to *sigh* 02:54:58 what's the problem with making anonymous functions bound to the scope they get assigned to? 02:55:08 hmmm... oh... well 02:55:11 yeah... that would be weird 02:55:16 that you then don't get closures. 02:55:18 var a = (x as function){ var x2 = x; x2(); }; 02:55:29 ^ That's the problem with it :) 02:56:13 I'm not sure I understand... wouldn't x2 be called in the scope of the "module" (or whatever plof calls it) 02:56:39 ... x2 is called in the scope of the function assigned to a. 02:57:22 which has access to... the global scope in which a is defined, right? 02:57:36 Right. But 'x' was presumably defined in some other scope. 02:57:44 And will be expecting variables from it. 02:57:55 this resembles the lisp mess with lambda vs. function, doesn't it? 02:58:34 * GregorR is not familiar with that particular mess ... not very familiar with LISP. 02:58:52 hmmmm..... if x2 is lexically scoped, what's the problem? 02:58:57 lambda is dynamically scoped, function is lexical, i think 02:59:06 (you said they were lexically scoped... anyways) 02:59:07 SevenInchBread: x2 was assigned x. 02:59:25 ...ah 02:59:26 SevenInchBread: So x2 will be called with a's scope, rather than x's scope. However, the function is still x. 03:00:00 right... the interpreter would make no distinction between literal lambda assignment and variably expanded assignment. 03:00:05 ah okay. 03:00:43 ...so, what's the difference between thin and thick functions again? 03:01:00 When you return from a function, it falls through all the thin functions and returns from the nearest thick function. 03:01:25 ......??? 03:01:40 oooh 03:01:46 There are no blocks but functions. But if you do: 03:01:54 a return in a thin function...... returns from the thin function it's defined in. 03:01:59 er... thick 03:01:59 Right 03:02:06 it's so you can do things like return in an if statement 03:02:11 Exactly. 03:02:20 Since you're really passing 'if' a function. 03:02:21 hmmm... sounds hackish to me... but eh. 03:02:34 It is hackish, but it's not as bad as what I had in Plof1 :P 03:02:44 It's the intersection between functional and imperative programming X_X 03:03:00 could you maybe do return if(whatever, {blah;blah;blah;return x}, {return whatever}); 03:03:16 have the if statement return the return value of the executed function. 03:03:29 What if you only want one side of the if to return? 03:03:47 hmmm, ah. 03:03:59 Like I said, intersection between functional and imperative :) 03:04:19 I thought thick and thin functions were something like ios blocks and methods.... 03:04:26 which largely fixes its scoping dillemma 03:04:50 They're sort of similar, but far more interchangeable. 03:05:20 what if you make it so only thick functions get reassigned scope? 03:05:49 heh... basically what if you make thin functions dynamical and thick functions lexical. :) 03:06:03 no, the other way around 03:06:14 ...er, maybe... I don't quite remember. 03:06:27 var a = (x as thick):{ var x2 = x; x2(); }; // why shouldn't this work? 03:06:59 because a thick function becomes a method... 03:07:40 hmm... typecasting thin and thick functions sounds like tricky business. 03:07:43 you could have automatic conversion between them. 03:08:29 (x as thin) would mean, don't reassign scope for x 03:08:48 Except that it would also mean that it's a thin function X_X 03:09:22 yes, but encapsulation is trivial 03:09:55 ...heh, more importantly... why would you do that? 03:10:24 that example.... or is it just as a "doesn't it just make sense that it should work this way" example. 03:10:29 if we take the smalltalk option that return can only return from methods... 03:11:05 I don't want to make this distinction between "methods" and "functions," especially since there are plenty of global functions that return. 03:11:45 ah okay yeah... you want thick and thin functions to be largely interchangable thanks to type conversion 03:12:08 * GregorR stabs himself to sleep. 03:13:06 heh.... this is nothing.... I had the insane idea of defining list-splits, attribute-access, and function calls with the same operator. 03:13:44 whitespace overloading anyone? 03:13:51 object attribute (called series of list (items with (subcalls)) huge parsing dillemma) 03:15:03 ...then I realized how stupid that would be 03:15:11 and then stole io's syntax. 03:16:21 actually that resembles some thoughts i have been having on ALPACA's syntax 03:16:49 I suppose it's possible.... 03:16:56 if you have explicit parenthesis for function calls 03:16:59 ....but I didn't 03:17:18 it was... quite strictly... "all functions are one argumented" 03:17:27 ...well, one or zero argumented 03:18:17 you do know about combinatory logic, right? 03:18:26 yup 03:19:01 I simplified things quite muchly with good-ol comma-separate lists. 03:19:32 and Smalltalkian keyword selector stuff. 03:21:06 [do stuff to things] if (x > 3) else [do (other stuff) to things] ....although if I figure out some crazy way to unify expressions with functions... I can make it look like 03:21:22 (do stuff to things) if (x > 3) else (do (other stuff) to things) 03:22:56 ....actually I just figured out how... but it's a little unintuitive to explain the semantics. 03:23:02 the syntax looks sleek and sexy though 03:26:55 basically you have expression wrapped up in an expression object of sorts.... and if the message isn't defined on the expression, the expression is evaluated and it gets sent to the returned object. 03:27:08 super-laziness.... only evaluated WHEN NECESSARY 03:27:44 now if you let obj meth = meth obj, (i.e. objects applied to things reversely apply them back) and use currying, then attribute access and function application _can_ have the same syntax. 03:28:52 it kind of does. 03:30:21 functions are objects that accept one message, and puts it into the source code. 03:30:39 er rather... places it iin the executioon scope. 03:30:47 now if you interpret (a b c) as \f. f a b c, then you can make lists of attributes interpolate 03:31:13 and... since lists are single messages... (you, can, pass, multiple, arguments) 03:31:41 lazily evaluated arguments... at that... 03:32:30 eh, are we talking about the same thing? 03:32:38 ...not really 03:32:40 :) 03:32:50 Everything is an object! 03:32:50 i was describing my ideas about ALPACA. 03:32:54 what are we talking about? 03:32:59 dunno 03:33:47 ALPACA conditions, suitably generalized, sort of look like a list of attributes applied iteratively. 03:34:03 but sometimes a function argument gets thrown in. 03:34:26 ...not sure I follow 03:34:58 like ^ is an attribute to find the cell above the current one 03:36:48 except i don't think the original ALPACA allows you to iterate them - you have to stay within the 8-cell neighborhood. 03:37:04 but that is what i mean by suitably generalized. 03:37:14 I'm trying to make creating objects suitably convient... because I think you could do a lot of nifty stuff with constructions... instead of the typical return-the-desired-value-immediately thing. 03:37:47 *convenient 03:38:09 like (x + 1) if (x > 3) will return a structure of sorts that works like a typical expression... but with an added else method. 03:38:38 if the next message is defined on the expression... it's execute... otherwise the expression is evaluated and the message delegated to the return. 03:38:48 so... if you did... 03:39:03 $hello = (x + 1) if (x > 3) 03:39:08 you could then do 03:39:21 hello else 3 03:39:27 or just as easily hello + 53 03:39:49 how lazy is haskell? 03:40:07 pretty lazy 03:40:48 everything is guaranteed to behave as if nothing is evaluated until it is needed. 03:40:48 -!- helios24 has quit (Read error: 104 (Connection reset by peer)). 03:41:34 oerjan, hmmm... does it preserve the evaluation... so it only evaluated once instead of everytime it's needed? 03:41:58 when is something needed? 03:41:58 in any reasonable implementation yes 03:42:23 -!- helios24 has joined. 03:42:32 although evaluating it _every_time_ happens to be equivalent except in speed, so strictly speaking that is legal too 03:42:35 depends on how you define the lanauge.... in the case of Sophia... it's whenever a message is passed to it. 03:44:30 in Haskell a value is needed when it is investigated by something that is itself needed. 03:45:05 -!- Sgeo has joined. 03:45:31 if a function call f x is needed, the function f will be. x may or may not be. 03:46:41 hmm... so nothing is evaluated until something that is being evaluated needs it to be evaluated in order for it itself to be evaluated? 03:46:57 ....I worded that strangely. 03:47:18 indeed, starting from the Main.main function, which is the only thing automatically needed. 03:47:44 or from whatever you give interactively if using a repl 03:49:47 or rather, main is evaluated to an IO action, which is performed, which may cause further evaluations. 03:49:58 etc. 03:51:35 there are however a couple of functions to get around lazy evaluation. 03:52:32 seq a b pretends to need a, evaluating it, then evaluates b and returns it. 03:53:04 and f $! x = seq x (f x) 03:55:19 also you can annotate record fields with ! so that they are automatically evaluated when the whole record is. 04:05:44 -!- SevenInchBread has quit (Read error: 113 (No route to host)). 04:57:22 -!- Sgeo has quit ("Ex-Chat"). 05:39:13 -!- oerjan has quit ("leaving"). 07:00:15 -!- FunnyMan3595 has joined. 07:03:54 -!- FunnyMan3595 has left (?). 07:19:19 -!- jix__ has joined. 07:39:43 -!- fax has joined. 07:39:59 hi 07:47:42 -!- jix__ has quit ("This computer has gone to sleep"). 07:50:07 -!- jix__ has joined. 07:59:59 -!- clog has quit (ended). 08:00:00 -!- clog has joined. 08:22:36 -!- jix__ has quit ("Bitte waehlen Sie eine Beerdigungnachricht"). 09:22:01 -!- puzzlet_ has joined. 09:33:35 -!- puzzlet has quit (Read error: 110 (Connection timed out)). 10:32:16 -!- puzzlet_ has quit (zelazny.freenode.net irc.freenode.net). 10:32:17 -!- sp3tt has quit (zelazny.freenode.net irc.freenode.net). 10:34:40 -!- puzzlet_ has joined. 10:34:40 -!- sp3tt has joined. 11:09:07 -!- ihope_ has joined. 11:09:16 -!- ihope_ has changed nick to ihope. 13:10:44 -!- pikhq has quit (Remote closed the connection). 13:11:03 -!- pikhq has joined. 14:11:12 * SimonRC hav drewn a pikcher: http://compsoc.dur.ac.uk/~sc/art/langs.png 14:16:59 I love it!!!! 14:17:14 thats going on my wall as soon as I fing a printer 14:19:13 erm, ok 14:19:41 They vary between the languages themselves and their stereotypical users 14:20:05 Perl and Java are based on people I know. 14:20:32 do APL and stuff 14:20:33 :D 14:21:02 * fax reads about epigram 14:21:09 I am not sure what they should look like 14:21:24 APL is an anarchist 14:22:49 wow epigram looks interesting 14:23:28 I know one of the main developers, otherwise I would not know about it. 14:24:05 I recommend learning Haskell, then learning the GADT extension to haskell before trying to tackle Epigram. 14:24:35 I wrote a LOGO interpreter in haskell 14:24:40 but its the only program I wrote 14:33:27 online anywhere? 14:33:45 the fact that you can write that as your first program shows what a poerful language Haskell it :-P 14:33:49 *is 14:34:43 oh it is 14:35:03 http://fax.twilightcoders.net/files/LOGO.zip 14:35:09 I think its awful code 14:35:33 1 sec 14:35:40 this is the usermanual http://img293.imageshack.us/img293/449/logovz4.png 14:37:18 -!- ihope has quit (Read error: 110 (Connection timed out)). 14:40:05 I got really pissed off with the state of implementations of scheme 14:40:15 & went on a rampage & wrote this 14:40:29 in scheme48 I could use glut but not networking at the same time 14:41:53 heh 14:47:07 looks great 14:47:16 thanks 14:47:26 OTOH, you got a head-start as you knew scheme and the libraries you were using 14:47:53 I don't use {;} much. maybe once every few hundred lines to fit something all on one line 14:49:08 I would have said "type M = ReaderT (Map String Float, Map String Function)" 14:49:09 I dunno I think that I wrote really bad haskell because I dont have any exp like writing things well 14:49:17 Whats that for? 14:50:00 M is what? 14:50:10 oh variables and functions 14:51:06 do you knw about monad transformers? 14:51:19 no :[ 14:51:35 I wanted to write a monad so I could make the turtle move 20 pixels per second 14:51:37 but I gave up by then 14:51:42 maybe ill do it sometime 14:54:27 M would allow you to have the current bindings available without haveing to explicitly pass them around so much 14:54:49 There's a tutorial about making a lisp interpreter that explains that sort of thing 14:55:08 oh yeah I skimmed the tutorial, I think ill read that properly then 14:55:27 its this? 14:55:27 http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/overview.html 14:58:49 bbs 15:02:31 -!- jix__ has joined. 15:07:53 -!- jix__ has changed nick to jix. 15:11:38 hmm 15:12:44 The problem with colonising other planets via STL means is that if you can build the damn colony ships there is no point sending them out of Earth orbit. 15:18:23 * fax back 15:20:20 -!- crathman has joined. 15:21:22 -!- ihope_ has joined. 15:21:30 -!- ihope_ has changed nick to ihope. 15:36:54 heh 15:37:25 The Daily WTF is launching OMGWTF -- "The Olympiad of Misguided Geeks at Worse Than Failure Programming Contest" 15:39:45 -!- goban has quit (Connection timed out). 15:47:11 -!- ihope has quit (Read error: 104 (Connection reset by peer)). 16:17:14 -!- goban has joined. 16:39:45 -!- goban has quit (Connection timed out). 16:43:22 -!- sebbu has joined. 16:51:52 -!- pikhq has quit (Read error: 110 (Connection timed out)). 16:54:40 -!- helios24 has quit (zelazny.freenode.net irc.freenode.net). 16:54:41 -!- bsmntbombdood has quit (zelazny.freenode.net irc.freenode.net). 16:54:41 -!- SimonRC has quit (zelazny.freenode.net irc.freenode.net). 16:54:43 -!- bsmntbombdood has joined. 16:54:44 -!- SimonRC has joined. 16:54:46 -!- helios24 has joined. 16:58:27 -!- pikhq has joined. 17:27:05 -!- goban has joined. 17:52:43 -!- goban has quit (Connection timed out). 17:53:01 -!- goban has joined. 21:01:11 -!- jix has quit ("Bitte waehlen Sie eine Beerdigungnachricht"). 21:38:41 -!- oerjan has joined. 21:47:19 SimonRC: those _are_ horns on the Cobol guy, right? 21:47:50 * oerjan wants to be a mix of the Scheme, Intercal and Epigram guy 22:13:47 erm 22:14:03 no 22:14:09 he just has a bad combover 22:14:24 oh :D 22:19:14 -!- goban has quit (Connection timed out). 22:22:51 -!- nazgjunk has joined. 22:23:22 hi 22:29:15 -!- puzzlet has joined. 22:29:54 -!- puzzlet_ has quit (Read error: 54 (Connection reset by peer)). 23:35:43 -!- goban has joined. 23:46:26 -!- crathman has quit ("ChatZilla 0.9.78.1 [Firefox 2.0.0.3/2007030919]").