00:00:00 --- log: started forth/17.04.09 00:15:13 --- quit: proteus-guy (Remote host closed the connection) 00:59:31 --- nick: DGASAU` -> DGASAU 01:05:32 --- quit: smokeink (Ping timeout: 240 seconds) 01:11:14 --- join: smokeink (~smoke@175.20.93.55) joined #forth 01:59:51 --- join: neceve (~ncv@unaffiliated/neceve) joined #forth 02:08:05 --- join: true-grue (~true-grue@176.14.222.10) joined #forth 02:25:21 --- quit: wa5qjh (Ping timeout: 252 seconds) 02:37:43 --- join: GeDaMo (~GeDaMo@212.225.127.213) joined #forth 03:09:40 --- join: ACE_Recliner (~ACE_Recli@c-50-165-178-74.hsd1.in.comcast.net) joined #forth 03:32:10 --- join: Bahman (~Bahman@88.247.101.164) joined #forth 04:35:32 --- quit: Bahman (Ping timeout: 240 seconds) 04:37:12 --- quit: dual (Ping timeout: 240 seconds) 04:39:00 --- join: dual (~bonafide@subzeroup.core.rzwireless.net) joined #forth 05:00:30 --- quit: smokeink (Remote host closed the connection) 05:27:45 --- join: smokeink (~smoke@175.20.93.55) joined #forth 05:34:38 --- join: Zarutian (~zarutian@168-110-22-46.fiber.hringdu.is) joined #forth 05:45:06 --- quit: dual (Ping timeout: 252 seconds) 06:29:52 --- join: gravicappa (~gravicapp@ppp83-237-163-164.pppoe.mtu-net.ru) joined #forth 06:37:19 --- join: joneshf-laptop (~joneshf@c-73-220-86-28.hsd1.ca.comcast.net) joined #forth 06:45:36 --- quit: smokeink (Ping timeout: 252 seconds) 07:41:25 --- join: dual (~bonafide@subzeroup.core.rzwireless.net) joined #forth 07:53:29 --- join: Bahman (~Bahman@88.247.101.164) joined #forth 07:53:57 --- quit: dys (Ping timeout: 240 seconds) 08:00:20 --- quit: joneshf-laptop (Quit: Leaving) 08:22:42 --- join: Bahman_ (~Bahman@88.247.101.164) joined #forth 08:22:51 --- quit: Bahman (Quit: ave atque vale) 08:32:56 --- quit: neceve (Quit: Konversation terminated!) 08:33:24 --- quit: Bahman_ (Ping timeout: 252 seconds) 09:05:09 --- join: joneshf-laptop (~joneshf@c-73-220-86-28.hsd1.ca.comcast.net) joined #forth 09:25:45 Zarutian: amForth is a 16-bit forth for 8-bit AVR's. 09:28:37 Lehs' arbitrary precision library supports numbers of any size. https://github.com/Lehs/BIG-INTEGER-ANS-FORTH It could be ported and adapted to run over 16 bits 09:34:26 If your forth supports recognizers, you could possibly add native bignum support and just use 1+ instead of b1+ and so on... no parallel namespace. 09:35:50 http://forthmath.blogspot.se/ 10:56:31 --- quit: ACE_Recliner (Ping timeout: 252 seconds) 11:20:27 I am not sure what recognizers are in Forth 11:21:26 I was mainly thinking about a compatibility wordlist that could enable one to run nearly-unmodified code that one got elsewhere. 11:27:32 Recognizers are part of forth-200x standard 11:27:34 http://amforth.sourceforge.net/pr/Recognizer-rfc-C.pdf 11:31:52 --- quit: dual (Ping timeout: 240 seconds) 11:33:41 --- join: dual (~bonafide@subzeroup.core.rzwireless.net) joined #forth 11:43:19 crc: thanks, I hadn't seen that before 11:46:49 --- join: dys (~dys@ip-109-40-0-240.web.vodafone.de) joined #forth 12:44:01 --- join: ACE_Recliner (~ACE_Recli@c-50-165-178-74.hsd1.in.comcast.net) joined #forth 12:53:01 --- join: vsg1990 (~vsg1990@static-72-88-80-103.bflony.fios.verizon.net) joined #forth 13:23:05 --- quit: GeDaMo (Remote host closed the connection) 13:51:23 --- quit: dual (Read error: No route to host) 13:55:56 --- join: dual (~bonafide@subzeroup.core.rzwireless.net) joined #forth 14:04:30 --- quit: gravicappa (Ping timeout: 252 seconds) 14:38:25 --- quit: true-grue (Read error: Connection reset by peer) 16:18:48 --- quit: nighty-- (Quit: Disappears in a puff of smoke) 16:48:05 --- join: neceve (~ncv@86.125.247.109) joined #forth 16:48:05 --- quit: neceve (Changing host) 16:48:05 --- join: neceve (~ncv@unaffiliated/neceve) joined #forth 16:59:32 --- quit: Zarutian (Quit: Zarutian) 17:40:41 --- join: nighty-- (~nighty@d246113.ppp.asahi-net.or.jp) joined #forth 18:06:21 --- quit: vsg1990 (Quit: Leaving) 18:33:37 --- join: smokeink (~smokeink@175.20.93.33) joined #forth 18:37:37 http://pastecode.ru/0c4f9b/ 18:40:29 I think you've left some stuff on the stack prior to using 10 by-ones 18:40:48 DO will take a range from the stack, so there's not anything to dup or increment 18:41:20 I get a stack underflow with your second example 18:41:36 use CLEARSTACKS if your implementation has it first 18:42:33 also note that the original by-ones doesn't make much sense either - LOOP naturally increments a counter so that it knows when it's done, and you can access this counter with the word 'i'. 18:43:43 on win32forth the second example runs even when the stack is empty (it doesn't underflow), but running it the second time will display numbers from 10 to 19, strange 18:44:03 huh, I think our forths are doing different things with LOOP 18:48:26 smokeink: not really strange; in your version the starting value comes from the stack. You are leaving the 9 there after the first run, so it starts from that. 18:49:20 why you don't get an error running it on an empty stack may be a bug or a design choice in win32forth 18:49:41 * crc hasn't touched win32forth in many years so can't say with certainty on this 18:49:47 that's what i thought but but after each run .S shows 'emtpy ok' 18:50:18 so 9 doesn't seem to be left on the stack , maybe it's a bug or i 'm doing something wrong 18:50:46 Likely in this case there's some room below the stack, and the value is stored in the underflowed memory. 18:51:08 I don't recall, does ANS define what happens when the stack underflows? 18:51:31 do you get an error on 'CLEARSTACKS +' ? 18:51:46 clearstacks is undefined 18:52:09 should this underflow? : : TEST 10 0 DO CR ." Hello " LOOP ; 18:52:20 no, that should work 18:52:59 then why should this? : BY-ONES ( n --) 0 DO CR DUP . 1 + LOOP ; 10 by-ones 18:53:21 it has 10 and 0 on the stack before DO is executed 18:53:24 DO consumes 2 cells, so there shouldn't be anything left on the stack to be DUP'ed. 18:53:33 oh 18:53:53 yeah dup runs well even when the stack is empty it seems 18:54:09 .S empty ok dup ok. .S [1] 70 ok 18:54:51 I'm feeling lucky that gforth checks for that. 18:54:53 reepca: 3.2.2.2 Other integer operations 18:54:53 In all integer arithmetic operations, both overflow and underflow shall be ignored. The value returned when either overflow or underflow occurs is implementation defined. 18:55:28 also, 4.1.2 lists underflow as an ambiguous condition 18:56:21 ok now i understand the role of that tuck, it's because do consumes 2 cells , cool 18:56:57 👍 19:11:26 --- join: proteusguy (~proteus-g@182.232.248.72) joined #forth 19:11:26 --- mode: ChanServ set +v proteusguy 19:15:49 --- quit: ACE_Recliner (Remote host closed the connection) 19:24:35 --- quit: dual (Ping timeout: 255 seconds) 19:34:30 why does this loop infinitely? http://pastecode.ru/c4dd22/ 19:36:01 --- quit: neceve (Quit: Konversation terminated!) 19:38:39 I think it's another symptom of some stack underflow weirdness - running it in gforth, I get a stack underflow after 3 innermost iterations. None of the loops are regenerating the input to the next loop. 19:39:53 --- quit: smokeink (Ping timeout: 255 seconds) 19:46:45 For example, if I was just using 2 nested loops, it would look something like : nested 0 cr do dup 0 do cr j . i . loop loop drop ; 19:52:44 --- join: smokeink (~smokeink@107.168.85.64) joined #forth 19:55:41 I think you missed what I said last - if you were using 2 nested loops instead of 3, it would look like : nested 0 cr do dup 0 do cr j . i . loop loop drop ; 19:56:50 thanks reepca 19:57:20 * smokeink i missed what you said but it's recorded here it seems http://bespin.org/~nef/logs/forth/17.04.09 20:06:06 it worked http://pastecode.ru/3c4828/ 20:28:32 Is it possible by means of metaprogramming to achieve this effect? : pastecode.ru/92d6bc/ 20:31:20 the thing is i need a 4 levels nested loop and i don't want to manually DUP and DROP in order to preserve the inside loops limits , i want to type some code then execute some word "loopme" or "nestme-in" that will take care of that automatically 20:31:53 Yep, the relevant words to look at are :NONAME and EXECUTE, though I wouldn't really call it metaprogramming at that point. It wouldn't look exactly the way you have it written down there, though. You would have procedure only say what it does on each iteration, and then do ' procedure 5 loopme (or ['] procedure 5 loopme if it's in a definition) 20:32:13 well, I guess :NONAME isn't exactly needed 20:32:54 ' SOMEWORD will give what's called an "execution token" (xt for short) of a word, and EXECUTE will then run the word whose execution token is on the top of the stack. 20:39:20 Do you need a variable number of iterations on each loop? 20:41:19 no 20:42:00 Then could you just put the literal number of iterations before the 0 in each loop? That way you don't have to keep DUPing and DROPing. 20:44:03 yeah, that's an option 20:45:16 http://pastecode.ru/b5e102b/ executing fiveA displays that error , any idea what's wrong ? 20:47:26 There's an ambiguity whenever you put a parsing word (word that looks to its right for a name or something like that) in a definition - do you want it to parse now, or do you want it to parse when the definition is executed? In this case, the ambiguity is resolved by having two separate words, ' and [']. ' will parse when the definition is executed, and ['] will parse when the definition is defined. 20:48:17 It looks like you want to parse when the definition is defined (currently it's looking to the right of fiveA to see which word's execution token should be looked up), so replace ' with ['] 20:49:55 got it 21:04:07 You could always define your own loop-like words, since the problem is just that LOOP is discarding the upper limit when the loop exits. You could define a version of LOOP that instead just puts it back on the stack - perhaps callit NESTLOOP or something. 21:05:42 ok 21:44:48 Also, here's a version and usage of NESTME that you might find useful. Only requires dropping at the outermost level, and no DUPing. http://sprunge.us/RHjG 21:47:32 very nice 21:54:32 --- quit: proteusguy (Ping timeout: 240 seconds) 22:40:22 it also works without do loop in inner1 : http://pastecode.ru/37c7e4/ 22:41:01 --- join: proteusguy (~proteus-g@182.232.248.72) joined #forth 22:41:18 --- mode: ChanServ set +v proteusguy 22:42:59 * smokeink in the above code there should be 4 drops at the end 23:13:16 --- quit: smokeink (Remote host closed the connection) 23:32:33 --- quit: dys (Read error: Connection reset by peer) 23:43:49 --- join: dys (~dys@ip-109-40-0-240.web.vodafone.de) joined #forth 23:48:40 --- quit: dys (Read error: Connection reset by peer) 23:51:14 --- join: smokeink (~smokeink@59.53.67.230) joined #forth 23:59:31 --- join: dys (~dys@ip-109-40-0-240.web.vodafone.de) joined #forth 23:59:59 --- log: ended forth/17.04.09