Conversation with #inferno at Sat Mar 21 22:50:00 2009 on powerman-asdf@irc.freenode.net (irc) (01:53:55) Fish left the room (quit: Remote closed the connection). (02:50:25) MrWGW is now known as xml (02:50:31) xml is now known as MrWGW (04:38:27) gualteri left the room (quit: "leaving"). (05:33:15) anothy_x left the room (quit: "Leaving."). (06:51:44) npe [n=npe@p1136-ipbf06wakayama.wakayama.ocn.ne.jp] entered the room. (08:42:56) andguent [n=andre@p4FF64A50.dip.t-dialin.net] entered the room. (10:32:42) npe left the room (quit: ). (11:48:25) Fish [n=SPARCman@AVelizy-152-1-1-157.w82-120.abo.wanadoo.fr] entered the room. (12:26:38) mjl- left the room (quit: "ircfs!"). (12:29:04) mjl- [n=none@85.17.62.110] entered the room. (13:44:14) KillerX [n=anant@gentoo/developer/KillerX] entered the room. (13:54:14) tombohannon [n=tombohan@70.61.70.10] entered the room. (13:57:41) tombohannon left the room (quit: Client Quit). (15:12:37) bdheeman [n=bdheeman@122.173.27.235] entered the room. (15:13:13) bdheeman left the room (quit: Client Quit). (16:14:03) anothy_lite left the room (quit: Read error: 104 (Connection reset by peer)). (16:19:28) tombohannon [n=tombohan@70.61.70.10] entered the room. (16:19:38) Fish left the room (quit: Remote closed the connection). (16:22:43) tombohannon left the room (quit: Client Quit). (16:23:54) anothy_lite [n=user@99.155.111.119] entered the room. (16:31:48) KillerX left the room (quit: ). (17:08:10) gdiaz_ [n=gdiaz@dos.9grid.es] entered the room. (17:08:12) gdiaz_: hello (17:15:04) gdiaz_: i need samples in how to walk lists of ADTs, using hd and tl how you know when you reached the end of a list? (17:15:12) gdiaz_: basic inferno stuff :) (17:18:59) gdiaz_: oh, list can be lists, so i must check agains the list istead of the element (17:22:47) mjl-: this is the typical way to do it: (17:22:55) mjl-: for(l := somelist; l != nil; l = tl l) (17:23:07) mjl-: e := hd l; # use e (17:24:35) gdiaz_: yes i just saw it on /appl/cmd/xargs.b. . . . (17:24:37) gdiaz_: thanks (17:24:43) gdiaz_: still i have some issues (17:25:11) gdiaz_: a func that can return an ADT if it is found or nil if its not found (17:25:20) gdiaz_: should i return ref ADT :-? (17:26:15) gdiaz_: or should i put a ref ADT as a param and return an int ? (17:30:18) mjl-: return a ref adt (17:30:37) mjl-: otherwise, you'ld have to "fill in" the passed ref adt (17:31:28) mjl-: find(l: list of ref Test, s: string): ref Test (17:31:28) mjl-: { (17:31:28) mjl-: for(; l != nil; l = tl l) (17:31:28) mjl-: if((hd l).s == s) (17:31:28) mjl-: return hd l; (17:31:29) mjl-: return nil; (17:31:31) mjl-: } (17:31:49) mjl-: where Test is an adt with a member s, which is a string (17:31:56) mjl-: that's fairly common in my code (17:32:23) gdiaz_: hd already returns a ref ? (17:32:37) gdiaz_: aaa the list is if ref's (17:32:41) gdiaz_: that's the trick i think (17:33:02) gdiaz_: ok, let's check all that, i'll put all of this on some notes. . . (18:05:57) aguent [n=andre@p4FF64C02.dip.t-dialin.net] entered the room. (18:22:52) andguent left the room (quit: Read error: 101 (Network is unreachable)). (18:48:48) gualteri [n=unknown@84.123.158.129.dyn.user.ono.com] entered the room. (19:46:03) aguent is now known as andguent (20:00:43) gualteri left the room (quit: "leaving"). (22:01:00) maht: there's also return (0, adt) and return(1, adt) if you *really* must return a full adt (if that works - I don; tknow I always use ref (22:25:33) newmanbe [n=btdn@138.74.131.25] entered the room. (22:57:51) tombohannon [n=tombohan@h117.255.18.98.static.ip.windstream.net] entered the room. (23:09:31) tombohannon left the room (quit: ). (23:11:46) andguent left the room (quit: "This computer has gone to sleep"). (23:25:56) m_m [n=none@ghillsrb1-pool2-211.mtco.com] entered the room. (00:14:34) tombohannon [n=tombohan@h117.255.18.98.static.ip.windstream.net] entered the room. (01:02:56) tombohannon left the room (quit: ). (01:19:49) eno__ [n=eno@adsl-70-137-182-59.dsl.snfc21.sbcglobal.net] entered the room. (01:22:59) eno left the room (quit: Read error: 145 (Connection timed out)). (01:30:42) underspecified left the room (quit: ). (01:32:00) underspecified [n=eric@softbank220043052007.bbtec.net] entered the room. (03:10:51) tombohannon [n=tombohan@h117.255.18.98.static.ip.windstream.net] entered the room. (03:28:29) tombohannon left the room (quit: ). (03:32:59) anothy_x [n=a@adsl-99-155-111-119.dsl.bcvloh.sbcglobal.net] entered the room. (03:42:12) eno__ is now known as eno (03:53:16) tombohannon [n=tombohan@h117.255.18.98.static.ip.windstream.net] entered the room. (03:59:53) tombohannon left the room (quit: ). (05:13:02) underspecified left the room (quit: ). (06:31:15) underspecified [n=eric@163.221.116.201] entered the room. (07:36:31) andguent [n=andre@p4FF64C02.dip.t-dialin.net] entered the room. (07:55:48) eno__ [n=eno@adsl-70-137-141-104.dsl.snfc21.sbcglobal.net] entered the room. (08:02:30) eno left the room (quit: Nick collision from services.). (08:02:37) eno__ is now known as eno (08:13:00) hotaru2k3 [n=hotaru@cpe-24-29-193-226.neo.res.rr.com] entered the room. (08:47:57) hotaru2k3 left the room (quit: "ChatZilla 0.9.84 [Firefox 3.1b3/20090305152042]"). (09:35:07) gdiaz_ left the room (quit: "[BX] The Power Rangers use BitchX. Shouldn't you?"). (10:02:12) andguent left the room (quit: Read error: 60 (Operation timed out)). (10:07:41) andguent [n=andre@p4FF64C02.dip.t-dialin.net] entered the room. (10:46:41) npe [i=npe@naist-wavenet125-203.naist.jp] entered the room. (11:22:48) gualteri [n=unknown@crespins.disca.upv.es] entered the room. (12:54:59) tombohannon [n=tombohan@h117.255.18.98.static.ip.windstream.net] entered the room. (12:56:51) npe left the room (quit: orwell.freenode.net irc.freenode.net). (12:56:51) anothy_x left the room (quit: orwell.freenode.net irc.freenode.net). (12:57:26) npe [i=npe@naist-wavenet125-203.naist.jp] entered the room. (12:57:26) anothy_x [n=a@adsl-99-155-111-119.dsl.bcvloh.sbcglobal.net] entered the room. (13:07:57) npe left the room (quit: ). (13:25:41) tombohannon left the room (quit: ). (13:54:52) KillerX [n=anant@gentoo/developer/KillerX] entered the room. (13:56:20) anothy_x left the room (quit: Read error: 104 (Connection reset by peer)). (14:27:30) tombohannon [n=tombohan@adsl-068-016-104-079.sip.asm.bellsouth.net] entered the room. (15:28:05) m_m left the room (quit: Remote closed the connection). (16:07:47) underspecified left the room (quit: ). (16:57:05) underspecified [n=eric@220.43.52.7] entered the room. (17:02:44) mennis [n=mennis@adsl-068-016-104-079.sip.asm.bellsouth.net] entered the room. (17:42:34) tombohannon_ [n=tombohan@adsl-068-016-104-079.sip.asm.bellsouth.net] entered the room. (17:42:34) tombohannon left the room (quit: Read error: 104 (Connection reset by peer)). (18:05:51) aguent [n=andre@p4FF66514.dip.t-dialin.net] entered the room. (18:23:06) andguent left the room (quit: Read error: 110 (Connection timed out)). (20:10:14) tombohannon [n=tombohan@adsl-068-016-104-079.sip.asm.bellsouth.net] entered the room. (20:10:14) tombohannon_ left the room (quit: Read error: 104 (Connection reset by peer)). (20:16:42) anothy_x [n=a@adsl-99-155-111-119.dsl.bcvloh.sbcglobal.net] entered the room. (20:26:28) anothy_x left the room (quit: "Leaving."). (20:36:32) gualteri left the room (quit: "leaving"). (21:10:34) KillerX left the room (quit: ). (21:27:29) tombohannon left the room (quit: ). (21:30:23) bdheeman [n=bdheeman@122.173.27.235] entered the room. (21:36:58) newmanbe left the room (quit: Connection reset by peer). (21:38:01) newmanbe [n=btdn@138.74.131.25] entered the room. (21:39:19) tombohannon [n=tombohan@adsl-068-016-104-079.sip.asm.bellsouth.net] entered the room. (22:00:32) aguent left the room (quit: "This computer has gone to sleep"). (22:01:18) bdheeman left the room. (22:43:22) soul9 is now known as [zai] (22:43:42) [zai] is now known as soul9 (22:44:12) soul9 is now known as morhange (22:47:28) morhange is now known as soul9 (23:20:24) anothy_x [n=a@99.155.111.119] entered the room. (23:30:03) tombohannon left the room (quit: ). (00:47:17) tombohannon [n=tombohan@h117.255.18.98.static.ip.windstream.net] entered the room. (04:03:15) tombohannon left the room (quit: ). (04:28:10) soul9 left the room (quit: orwell.freenode.net irc.freenode.net). (04:28:42) soul9 [n=BOFH@unaffiliated/johnnybuoy] entered the room. (04:30:06) soul9 is now known as Guest29541 (04:53:50) olegfink left the room (quit: Remote closed the connection). (05:04:13) olegfink [n=olegfink@62.141.52.142] entered the room. (05:45:38) aguent [n=andre@p4FF66514.dip.t-dialin.net] entered the room. (06:15:48) aguent left the room (quit: "Leaving"). (06:20:29) newmanbe left the room (quit: Read error: 110 (Connection timed out)). (08:48:25) andguent [n=andre@p4FF66514.dip.t-dialin.net] entered the room. (10:08:59) KillerX [n=anant@gentoo/developer/KillerX] entered the room. (10:26:25) Guest29541 is now known as soul9 (10:51:06) npe [n=npe@pw126246090232.6.tik.panda-world.ne.jp] entered the room. (10:58:08) npe left the room (quit: "Get Colloquy for iPhone! http://mobile.colloquy.info/"). (11:29:51) npe [n=npe@pw126246090232.6.tik.panda-world.ne.jp] entered the room. (11:30:09) npe left the room (quit: Remote closed the connection). (12:57:52) tombohannon [n=tombohan@h117.255.18.98.static.ip.windstream.net] entered the room. (13:40:55) tombohannon left the room (quit: ). (14:02:14) anothy_x left the room (quit: "Leaving."). (14:31:44) anothy_lite left the room (quit: Read error: 104 (Connection reset by peer)). (14:32:34) newmanbe [n=btdn@138.74.131.25] entered the room. (14:38:42) tombohannon [n=tombohan@adsl-068-016-104-079.sip.asm.bellsouth.net] entered the room. (14:43:08) newmanbe left the room (quit: Read error: 104 (Connection reset by peer)). (15:52:39) underspecified left the room (quit: ). (15:54:37) underspecified [n=eric@softbank220043052007.bbtec.net] entered the room. (18:05:58) aguent [n=andre@p4FF661D8.dip.t-dialin.net] entered the room. (18:21:59) andguent left the room (quit: Read error: 101 (Network is unreachable)). (19:14:43) tombohannon left the room (quit: ). (19:22:56) gdiaz_ [n=gdiaz@dos.9grid.es] entered the room. (19:23:21) gdiaz_: adding elements to an end of a list. . . it is always done using a reverse function? (19:23:53) mjl-: yes, or lists->concat (19:24:00) mjl-: (which does the reverse, i think) (19:24:12) mjl-: lists are not ideal for that use-case (19:24:24) mjl-: if the lists are short, it doesn't matter though (19:24:30) mjl-: (matter for efficiency) (19:30:05) gdiaz_: hum and i can't read it in reverse right? (19:30:16) mjl-: nopes, the you have to reverse too (19:30:20) gdiaz_: i meant, there is no way to access the end of the list directly. . (19:30:23) mjl-: but you can just keep the list in reversed order ;) (19:30:37) gdiaz_: too bad. . . (19:30:49) gdiaz_: well putting a tree in a list means the order of the list matter (19:31:50) gdiaz_: and with no pointers the way of building a chanined list is using refs and ADTs right? (19:31:52) mjl-: if you need to add to/take from a list/array at both head & tail, you could write an adt that does that efficiently. e.g. using arrays that you enlarge/shorten from time to time. (19:32:18) gdiaz_: hum. . . . (19:32:53) C-Keen: sounds like yet another linked list implementation? (19:32:59) mjl-: jups (19:33:05) mjl-: perhaps there is an existing one. (19:33:14) mjl-: perhaps just using a list and reversing is enough (19:33:15) gdiaz_: my lisp translation relay on list handling, i guess i need an array. . . , but chained list are so convenient sometimes. . . (19:33:43) mjl-: chained lists are probably a bit of a pain because you'll encounter cyclic adt's... (19:33:57) mjl-: well, chained ref adt's will cause them. (19:34:17) gdiaz_: yes, i read about that in the infero programming book (19:34:30) mjl-: of course, they are not really a pain :) (19:34:39) mjl-: they are just less quickly garbage collectable (19:35:22) C-Keen: which is not an issue for most use cases since you hardly have such short living linked lists (19:35:30) C-Keen: or at least you shouldn't :) (19:36:00) gdiaz_: hum, i like the hd and tl operators they are very much like car and cadr lisp operators. . . (19:37:06) C-Keen: tl is pretty inefficient in lisp (19:37:18) C-Keen: at least in haskell since you need to compute the whole list (19:37:22) C-Keen: to know where it ends (19:37:39) C-Keen: bye bye (20:01:32) gdiaz_: hum off to home, i'll play more tomorrow, but this data_type things are frustrating coming from c sometimes :) (20:02:03) gdiaz_: obviously all that frustratios dissappears when i see no malloc's and realoc's and free's :-D (20:02:19) gdiaz_ left the room (quit: "[BX] We drink more beers than Norm on Cheers!"). (21:03:03) tombohannon [n=tombohan@adsl-068-016-104-079.sip.asm.bellsouth.net] entered the room. (22:04:57) mennis left the room (quit: Read error: 54 (Connection reset by peer)). (22:04:58) mennis_ [n=mennis@adsl-068-016-104-079.sip.asm.bellsouth.net] entered the room. (22:53:13) tombohannon left the room (quit: ). (23:00:19) aguent left the room (quit: "This computer has gone to sleep"). (23:21:17) uriel: mjl-: IIRC ozInferno has a rev operator (23:30:58) newmanbe [n=btdn@138.74.131.25] entered the room. (00:07:05) mennis [n=mennis@adsl-068-016-104-079.sip.asm.bellsouth.net] entered the room. (00:07:58) mennis_ left the room (quit: Read error: 104 (Connection reset by peer)). (00:08:05) mennis left the room (quit: Client Quit). (01:14:42) olegfink left the room (quit: Read error: 60 (Operation timed out)). (01:18:21) olegfink [n=olegfink@62.141.52.142] entered the room. (01:34:11) caerwyn [n=chatzill@c-76-119-5-71.hsd1.ma.comcast.net] entered the room. (02:06:39) KillerX left the room (quit: ). (02:34:17) underspecified left the room (quit: ). (03:37:59) tombohannon [n=tombohan@h117.255.18.98.static.ip.windstream.net] entered the room. (03:39:20) caerwyn left the room (quit: "ChatZilla 0.9.84 [Firefox 3.0.7/2009021910]"). (03:44:09) underspecified [n=eric@isa7-dhcp-116-217.naist.jp] entered the room. (04:20:47) anothy_x [n=a@c-68-38-23-239.hsd1.nj.comcast.net] entered the room. (04:34:42) underspecified left the room (quit: ). (04:37:29) newmanbe left the room (quit: Read error: 110 (Connection timed out)). (05:07:31) mennis [n=mennis@adsl-152-92-94.asm.bellsouth.net] entered the room. (05:44:19) mennis left the room (quit: Client Quit). (05:53:49) mennis [n=mennis@adsl-152-92-94.asm.bellsouth.net] entered the room. (06:45:12) mennis left the room (quit: Client Quit). (07:55:12) aguent [n=andre@p4FF661D8.dip.t-dialin.net] entered the room. (09:03:44) underspecified [n=eric@isa7-dhcp-116-217.naist.jp] entered the room. (09:10:00) underspecified_ [n=eric-n@leopard175.naist.jp] entered the room. (09:11:56) underspecified left the room (quit: ). (10:35:03) anothy_x left the room (quit: "Leaving."). (11:36:55) mjl-: morning (11:41:14) C-Keen: hi mjl- (11:41:28) mjl-: yo c-keen (11:41:33) mjl-: doing any inferno/limbo stuff today? (11:42:04) C-Keen: I doubt it :/ (11:43:25) mjl-: bummer (11:43:35) mjl-: but i bet there is other interesting stuff to day (11:52:27) C-Keen: lots (11:53:14) C-Keen: mostly work though (12:37:04) gdiaz_ [n=gdiaz@dos.9grid.es] entered the room. (12:59:45) KillerX [n=anant@gentoo/developer/KillerX] entered the room. (13:24:33) tombohannon left the room (quit: ). (13:30:55) tombohannon [n=tombohan@h117.255.18.98.static.ip.windstream.net] entered the room. (13:33:18) tombohannon left the room (quit: Client Quit). (14:59:50) anothy_x [n=a@c-68-38-23-239.hsd1.nj.comcast.net] entered the room. (15:28:40) npe [n=npe@pw126246102135.6.tik.panda-world.ne.jp] entered the room. (15:31:11) npe_ [i=npe@dn157-088.naist.jp] entered the room. (15:35:38) npe left the room (quit: "Get Colloquy for iPhone! http://mobile.colloquy.info/"). (15:35:51) npe_ is now known as npe (15:59:17) tombohannon [n=tombohan@adsl-068-016-104-079.sip.asm.bellsouth.net] entered the room. (16:29:10) mennis [n=mennis@adsl-068-016-104-079.sip.asm.bellsouth.net] entered the room. (16:43:16) anothy_x left the room (quit: "Leaving."). (16:51:53) anothy_x [n=a@nj-71-0-101-209.dyn.embarqhsd.net] entered the room. (17:02:54) underspecified [n=eric@220.43.52.7] entered the room. (17:11:09) anothy_x left the room (quit: Read error: 110 (Connection timed out)). (17:55:25) mennis left the room (quit: Client Quit). (17:59:06) mennis [n=mennis@adsl-068-016-104-079.sip.asm.bellsouth.net] entered the room. (18:06:20) andguent [n=andre@p4FF6780A.dip.t-dialin.net] entered the room. (18:23:50) aguent left the room (quit: Read error: 110 (Connection timed out)).