00:00:00 --- log: started forth/11.04.12 00:15:20 --- quit: gogonkt (Read error: Operation timed out) 00:19:37 --- join: gogonkt (~gogonkt@2001:5c0:1000:b::905f) joined #forth 00:56:14 --- quit: roarde (Quit: Leaving) 01:02:38 --- join: ASau``` (~user@95-28-62-73.broadband.corbina.ru) joined #forth 01:03:52 --- join: ASau` (~user@95-28-62-73.broadband.corbina.ru) joined #forth 01:08:09 --- quit: ASau (Ping timeout: 276 seconds) 01:26:10 --- quit: DocPlatypus (Quit: Leaving) 02:30:05 --- quit: gogonkt (Ping timeout: 260 seconds) 02:30:52 --- join: gogonkt (~gogonkt@2001:5c0:1000:b::9c11) joined #forth 02:31:07 --- quit: ASau``` (Remote host closed the connection) 02:31:53 --- join: ASau``` (~user@95-28-62-73.broadband.corbina.ru) joined #forth 02:59:25 --- join: MayDaniel (~MayDaniel@unaffiliated/maydaniel) joined #forth 03:06:39 --- quit: MayDaniel (Read error: Connection reset by peer) 03:10:13 --- join: MayDaniel (~MayDaniel@unaffiliated/maydaniel) joined #forth 03:38:20 --- quit: Fox78 (Read error: Connection reset by peer) 03:38:31 --- join: Fox78 (~fox@123.121.61.150) joined #forth 04:01:55 --- quit: MayDaniel (Read error: Connection reset by peer) 07:02:25 --- join: MayDaniel (~MayDaniel@unaffiliated/maydaniel) joined #forth 07:05:15 --- quit: gogonkt (Read error: Operation timed out) 07:08:33 --- join: gogonkt (~gogonkt@2001:5c0:1000:b::9ceb) joined #forth 07:22:13 --- quit: gogonkt (Ping timeout: 260 seconds) 07:23:02 --- join: gogonkt (~gogonkt@2001:5c0:1000:b::9a97) joined #forth 07:39:36 --- quit: MayDaniel () 07:41:52 --- join: arquebus (~arquebus@201.160.3.219.cable.dyn.cableonline.com.mx) joined #forth 07:45:22 --- part: arquebus left #forth 08:02:40 --- quit: TreyB (Quit: Leaving.) 08:46:42 --- quit: Fox78 (Ping timeout: 276 seconds) 08:53:57 --- join: Fox78 (~fox@123.121.61.150) joined #forth 09:07:27 --- quit: gogonkt (Ping timeout: 260 seconds) 09:07:52 --- join: gogonkt (~gogonkt@2001:5c0:1000:b::98e9) joined #forth 09:18:57 --- join: MayDaniel (~MayDaniel@unaffiliated/maydaniel) joined #forth 09:25:38 --- quit: gogonkt (Ping timeout: 248 seconds) 09:26:14 --- join: gogonkt (~gogonkt@2001:5c0:1000:b::9d9f) joined #forth 09:52:54 --- quit: MayDaniel (Read error: Connection reset by peer) 10:02:25 --- join: ygrek (debian-tor@gateway/tor-sasl/ygrek) joined #forth 10:04:36 --- quit: martinhex (Remote host closed the connection) 10:05:06 --- join: martinhex (~mjc@93-97-29-243.zone5.bethere.co.uk) joined #forth 10:38:42 --- quit: uiu (Read error: Connection reset by peer) 10:44:07 --- join: uiu (~ian@HSI-KBW-095-208-003-067.hsi5.kabel-badenwuerttemberg.de) joined #forth 10:53:13 --- quit: uiu (Read error: Connection reset by peer) 11:32:34 --- quit: ygrek (Ping timeout: 246 seconds) 11:49:22 --- join: xpololz (~tommy@50.80-203-124.nextgentel.com) joined #forth 13:30:48 --- quit: gogonkt (Read error: Operation timed out) 13:34:20 --- join: gogonkt (~gogonkt@2001:5c0:1000:b::9c93) joined #forth 13:48:57 --- join: MayDaniel (~MayDaniel@unaffiliated/maydaniel) joined #forth 14:20:47 --- join: I440r (~mark4@108-64-168-250.lightspeed.wepbfl.sbcglobal.net) joined #forth 14:20:47 --- mode: ChanServ set +o I440r 15:07:30 --- join: haole (~ivan@186.223.216.119) joined #forth 15:08:35 hello there... i'm trying to define a basic array structure in gforth, but i always get "Invalid memory address" errors when I attempt any operations on the address i got... what could be wrong? my array: : array create cells allot does> cells + ; 15:09:34 alignment? 15:12:26 Free-man: don't know... i found this in gforth's manual >> When Gforth is running under an operating system you may get Invalid memory address errors if you attempt to access arbitrary locations 15:12:54 haole: write stack effect. 15:13:53 ASau`: ( n -- ) ( i -- addr ) ... why? 15:14:37 --- quit: gogonkt (Ping timeout: 264 seconds) 15:14:39 Free-man: i tried it like this: : array create cells align allot does> cells + aligned ;... same problem 15:15:03 --- join: gogonkt (~gogonkt@2001:5c0:1000:b::8a27) joined #forth 15:16:03 haole: because you did it wrong. 15:16:31 i'm trying to understand how create works 15:16:31 haole: what is the stack at the point between "does>" and "cells"? 15:16:55 probably just a cell 15:17:17 First of all, it is wrong, second, "just a cell" doesn't answer anything. 15:17:21 What is this cell? 15:17:29 the index of my array 15:17:34 Wrong. 15:18:49 if i use my array like this: 5 array a1, i don't get anything in my stacks 15:18:58 Right. 15:19:07 That's because you invoke initializer. 15:19:13 also, if i access it like this: 0 a1, for example, it dumps me something that looks like an address in the stack 15:19:35 Why are you calling it "0 a1"? 15:19:51 because i want the address of the 0 th position of my array 15:19:51 What is the stack between "does>" and "cells"? 15:20:12 what was already there, right? does> doesn't put anything in it 15:20:28 This is wrong. 15:20:42 Redefine the word, only put ".s" there. 15:20:51 So that you could see what's happening there. 15:20:56 k 15:21:57 Perhaps you need to add "cr" after ".s". 15:22:10 So that stdio would flush it to tty before you crash. 15:22:19 no... it seemed to work... i got the 0 that was already there and an address... stack depth is now 2 15:22:42 it doesn't crash when i use "0 a1", it crashes when i fetch this address 15:23:13 What does it print when you run "0 a1"? 15:23:45 0 a1 <2> 0 7F1AD3A2CED8 ok 15:24:04 Do you have any idea why there're two values? 15:24:51 If you still don't understand what happens there, add more ".s cr". 15:26:09 adding that cr gave me another address! now there are 3 things in the stack 15:26:16 ok... i don't have a clue of what's going on lol 15:27:12 Then you ought not to use "does>". 15:28:03 i just wanted an array with simple syntax :( 15:28:05 i failed 15:28:13 Implementing arrays with it is bad idea anyway. 15:29:40 but if i only allocate the memory needed for it, i will have to keep repeating syntax like this: 0 cells + n1 @ 15:29:48 is this what you suggest? 15:29:54 Yes. 15:30:04 Only you write it wrong here. 15:31:45 is it worth to pay the price of boiler plate to get closure? 15:32:43 "create ... does> ..." is essentially a closure generator. 15:33:40 It constructs static closures. 15:38:19 what did I wrote wrong? 0 cells + a1 @ works 15:40:37 Write stack effect. 15:40:48 Just go word by word and write it. 15:41:31 This is your main problem. 15:42:56 but now i don't even know what is the problem that i have, since if i write "22 0 cells + a1 !" and then "0 cells + a1 @ ." i get 22!!! 15:43:09 Sure. 15:43:16 Because you don't understand what happens there. 15:43:46 Before you understand elementary things, you are hopeless with "does>". 15:44:17 but i gave up on does>! like you told me :D 15:44:34 i'm just allocating and accessing through this awkward syntax 15:47:08 Alright, alright. 15:47:20 You don't understand what's going on even without "does>". 15:48:31 Clear the stack and print it after each word. 15:48:32 i've just read a book about forth and i don't have yet a complete figure of whats going on underneath 15:48:40 ok 15:48:49 You don't need to understand what's going "underneath". 15:49:02 You should understand what is going on. 15:49:10 Don't dive into implementation details. 15:49:33 Consider those words from gforth primitive. 15:50:15 wow, i think that the + and the a1 are inverted 15:50:16 right? 15:50:39 it was working because of some trash in my stack 15:50:48 Right. 15:51:21 Morning :) 15:51:32 haole: hint: 15:51:32 so, the thing between does> and cells that you mentioned was a1's address 15:51:36 : th cells + ; 15:51:48 that looks cool 15:51:48 Then you can write "0 a i th !" 15:51:49 thanks :) 15:52:18 forth is a lot about nice ideas... it doesn't work to just fight with the language :D 15:52:54 These are not nice ideas actually. 15:53:04 Don't drink too much kool-aid. 15:54:20 well... it gave my nice syntax and it was simple... that's the point 15:54:25 s/my/me 15:56:12 --- quit: MayDaniel (Read error: Connection reset by peer) 15:57:04 You haven't written anything serious in it yet. 16:28:33 --- quit: haole (Quit: Ex-Chat) 17:01:24 --- quit: gogonkt (Read error: Operation timed out) 17:03:53 --- join: gogonkt (~gogonkt@2001:5c0:1000:b::977f) joined #forth 17:47:09 --- quit: Fox78 (Remote host closed the connection) 18:05:31 --- join: Al2O3 (~Al2O3@c-75-70-8-212.hsd1.co.comcast.net) joined #forth 18:16:16 --- quit: ASau` (Remote host closed the connection) 18:18:02 --- join: ASau` (~user@95-28-62-73.broadband.corbina.ru) joined #forth 18:36:45 --- quit: Snoopy_1611 () 18:38:28 --- join: Snoopy_1611 (Snoopy_161@dslb-088-068-022-028.pools.arcor-ip.net) joined #forth 18:54:21 --- quit: gogonkt (Remote host closed the connection) 18:54:33 --- join: gogonkt (~gogonkt@2001:5c0:1000:b::9f0f) joined #forth 19:54:18 --- join: Fox78 (~fox@123.121.61.150) joined #forth 21:14:50 --- join: nighty__ (~nighty@210.188.173.245) joined #forth 21:38:13 --- quit: Snoopy_1611 () 21:44:08 --- join: Snoopy_1611 (Snoopy_161@dslb-178-004-071-234.pools.arcor-ip.net) joined #forth 22:09:17 --- quit: nighty__ (Ping timeout: 258 seconds) 22:35:45 --- quit: I440r (Read error: Connection reset by peer) 22:49:03 --- quit: gogonkt (Ping timeout: 260 seconds) 22:50:24 --- join: gogonkt (~gogonkt@2001:5c0:1000:b::9c91) joined #forth 22:56:17 --- quit: gogonkt (Ping timeout: 260 seconds) 22:57:07 --- join: gogonkt (~gogonkt@2001:5c0:1000:b::9c91) joined #forth 23:04:31 --- quit: gogonkt (Ping timeout: 248 seconds) 23:05:24 --- join: gogonkt (~gogonkt@2001:5c0:1000:b::a0a5) joined #forth 23:26:33 --- quit: gogonkt (Read error: Operation timed out) 23:29:56 --- join: gogonkt (~gogonkt@2001:5c0:1000:b::9d39) joined #forth 23:47:33 --- join: ygrek (debian-tor@gateway/tor-sasl/ygrek) joined #forth 23:59:59 --- log: ended forth/11.04.12