00:00:00 --- log: started forth/11.12.21 00:03:43 --- join: karswell (~coat@93-97-29-243.zone5.bethere.co.uk) joined #forth 01:24:55 --- join: xpololz (~xpol@50.80-203-124.nextgentel.com) joined #forth 02:17:03 --- quit: Snoopy_1611 () 02:19:18 --- join: ttmrichter (~ttmrichte@122.225.105.252) joined #forth 02:35:26 --- join: newbie999 (~KVirc5.01@194.146.231.250) joined #forth 02:36:09 Hi. How can I shield symbol with Forth ? 02:39:41 Shield symbol? What do you mean? 02:40:45 ttmrichter: Like \ in Bash 02:42:55 I'm still lost. \n doesn't shield anything in Bash. 02:43:08 What are you trying to accomplish. Back up a level. 02:43:25 Don't tell me the strategy you're trying to use, tell me what you're trying to accomplish with it. 02:45:40 ttmrichter: In Bash I can use \! and this "!" special character just print as string "!". How I can do this with Forth ? 02:46:25 ." i" 02:47:01 ." !" ( try that one ) 02:50:00 33 emit ( prints to your terminal or standard output the ASCII character with value 33 ) 02:50:37 xpololz: Don't work, I have "+string" and need do this for "+" there 02:51:15 ? 02:51:20 I'm very confused, newbie999: you print a string as xpololz showed. 02:51:32 ." whatever string you want to type here" 02:52:01 Again, what are you trying to accomplish? The end goal, not the strategy. 02:52:15 newbie999: are you forgetting the space after the open quote 02:52:25 because that is the only thing i could imagine to cause that to fail 02:53:20 ." +string" not ."+string" 02:53:45 Yes, i try both variants - no success 02:54:09 what happens and what implementation are you using 02:55:04 It is SP-Forth 02:55:39 Here's what I get with PFE: 02:55:39 cr ." +string" cr 02:55:40 +string 02:55:40 ok 02:56:33 Try cutting and pasting that line (beginning with cr) into SP-Forth's console directly. 02:56:35 Not typing. 02:56:37 Cut and paste. 02:57:37 newbie999: ." seems to be compile-only in spf 02:57:51 but other than that it works fine for me 02:58:39 newbie999: i mean, it looks like you can only use ." inside a definition in sp-forth. if you do it at the interpreter, it will fail and that does not depend on the string contents 03:00:55 Ouch. That's a bit of an ugly limitation. 03:01:06 Or ... 03:01:13 Actually, in retrospect probably not. 03:01:23 How often do you have to print messages interactively? 03:02:10 when interactively testing code that prints messages 03:03:09 is there some fig-forth equivalent of noname 03:03:42 er :noname 03:06:27 --- quit: ASau` (Read error: Connection reset by peer) 03:13:09 koisoke: Isn't it more usual to test words that might contain messages? 03:13:14 If so, they'll be compiled. 03:15:31 --- quit: karswell (Ping timeout: 252 seconds) 03:15:48 ttmrichter: certainly 03:16:33 --- join: karswell (~coat@93-97-29-243.zone5.bethere.co.uk) joined #forth 03:20:23 looks like you can use .( interactively 03:20:56 but obviously not in a definition if you want output at runtime 03:22:13 but i can't think of a situation where you would need to use ." interactively if you cannot make loops interactively 03:24:00 UGH. case sensitivity and all built-in words in uppercase is an awful combination 03:56:46 --- quit: karswell (Ping timeout: 255 seconds) 04:04:21 No, there's no fig-forth equivalent. 04:04:29 Don't use fig-forth. 04:04:38 It has way more bugs than you think. 04:05:16 As for SP-Forth, it is hard to tell. 04:05:37 The implementation is the most pragmatic one when you count free implementations. 04:35:31 --- join: karswell (~coat@93-97-29-243.zone5.bethere.co.uk) joined #forth 04:42:01 --- quit: karswell (Ping timeout: 252 seconds) 05:08:16 Any recommendations of simple a program I could implement? -- Which enforces good Forth style/practice? 05:09:32 Anything goes. 05:56:11 --- quit: ttmrichter (Ping timeout: 240 seconds) 06:29:53 --- join: nighty- (~nighty@static-68-179-124-161.ptr.terago.net) joined #forth 08:32:07 --- join: karswell (~coat@93-97-29-243.zone5.bethere.co.uk) joined #forth 08:46:32 --- part: newbie999 left #forth 11:32:37 --- join: truefx (~hasan@88.250.93.191) joined #forth 11:32:46 what is the minimal subset of forth words which can be used to define all the other words ? 11:34:49 in forth of course :) 11:38:38 minimum turing complete set or the minimum to actually be usable? for the latter, a good start would be http://www.colorforth.com/forth.html 11:40:28 minimum turing complete set, would that not be usable too? :-) 11:41:10 xpololz: it would be hopelessly slow with any straightforward implementation 11:41:30 okay 11:55:53 is colorforth some kind of minimal subset of forth ? so may i port to forth to any platform using minimal assembly language coding ? without special color editors ? 11:56:24 xpololz, koisoke ? 12:11:27 --- join: MayDaniel (~MayDaniel@unaffiliated/maydaniel) joined #forth 12:15:00 truefx: I have 31 primitives which I use to build my varient of forth 12:15:47 what"s your variant ? is it available for dl ? 12:17:02 and 31 is it not too much ? 12:17:07 http://retroforth.org 12:17:23 i ve already seen it 12:17:37 I could have used less, but 31 was the minimal set I was comfortable with 12:17:41 --- quit: karswell (Read error: Operation timed out) 12:17:43 for android cromium app and extensions 12:18:11 it runs on other platforms too 12:19:42 if you're looking for a minimal base, eforth may be worthwhile 12:25:22 --- quit: truefx (Read error: Connection reset by peer) 12:26:24 --- join: truefx (~hasan@88.250.93.191) joined #forth 12:26:40 crc, yep thats what im looking for 12:27:29 eForth is the smallest conventional Forth I'm aware of in terms of primitives (30 IIRC) 12:27:37 crc, in fact ill implement my variant in my own native language but i need some maybe radical changes in design. I have problem with delimiters 12:28:41 --- join: ASau (~user@93-80-123-145.broadband.corbina.ru) joined #forth 12:28:46 how so? 12:29:44 hmmm let me try to find a way to explain 12:31:39 can you follow if i use some Turkish words in control structures 3-4 12:32:05 I'll try 12:32:13 Shoot, and we'll see. 12:32:40 if ... else .... then ; is in my language ise ... degilse .... sonra 12:33:14 (Doesn't "son" mean "end"?..) 12:33:25 case .... of ....endof ..... of ... endof ..... endcase 12:33:38 yep son means end sonra mean later, then 12:34:30 but if i use sonra then in if structure it makes if structure somehow broken for humans 12:34:35 semantically 12:35:21 so in my implementation it should be ise ...... degilse ...... (dot) to end structure 12:35:58 but same same delimiter should be in case too 12:36:02 (dot) 12:36:44 Do you mean instead of "endcase"? 12:36:44 case (eger) ..... of (ise) ..... endof ( , ) ...... endcase ( . ) 12:36:49 yep 12:36:56 No, that doesn't work well. 12:37:25 cant i overcome this even if i complicate parser somehow ? 12:37:42 You can, but that makes parsing harder. 12:38:12 and cant i simplify this complexity using a color editor ? 12:38:16 Also, dot is used to print numbers. 12:38:16 to normal level ? 12:38:26 i ll change it too 12:38:46 its not an issue just replacement 12:38:52 Well... 12:39:08 but using same demiliters in different control structures its an issue 12:39:13 Before you understand how "if" and "case" are implemented, 12:39:13 I suggest not to go further. 12:39:41 i have already read about gforths manual 12:39:56 about control structures mostly 12:40:08 defining your own structrues etc. 12:40:12 In manual or in source? 12:40:25 not in source 12:40:27 yet 12:40:42 I don't see what you could understand then. 12:40:53 just warming up 3 days of acquintace with forth 12:41:02 i do a lot in fact 12:42:59 http://pastebin.com/YPkkew53 -- could anyone have a quick look at this one? I don't quite why it's not working 12:43:05 insertion sort, doesn't sort very well. 12:46:40 xpololz: I suggest you implement "@swap" that swaps memory cells. 12:46:52 It simplifies definition a lot. 12:47:01 Then go back :) 12:47:41 thanks 12:53:43 I still don't quite get it though :-/ 12:56:18 Define @swap that exchange two cells in memory. 12:56:23 ( ptr1 ptr2 -- ) 12:56:35 i did that, no problem :p 12:56:35 Then redefine your sort using @swap. 12:56:39 and it works fine too 12:56:51 Now post what you got. :) 12:57:12 http://pastebin.com/1ADQ6VkU 12:58:11 Index of your loop runs from 1 to (n-2). 12:58:16 Is that intentional? 12:58:57 oh, yeah it does, no it wasn't intentional 12:59:20 I was, err.. thinking wrong. 12:59:24 :-) 13:00:18 Another thing that could simplify is using pointers instead of indices. 13:00:24 You have "cell+" exactly for that. 13:08:39 http://pastebin.com/mmKNc82c 13:09:54 "over @ over @" looks more regular. 13:11:30 yeah 13:12:38 --- join: Snoopy_1611 (Snoopy_161@dslb-088-069-138-048.pools.arcor-ip.net) joined #forth 13:12:45 Also, I don't think it's insertion sort, 13:12:54 you're comparing neighbouring cells. 13:14:59 that's true, stil lexpected it to sort it all out though 13:16:10 but it's semantics? 13:17:54 http://en.wikipedia.org/wiki/File:Insertion-sort-example-300px.gif 13:18:43 Well... 13:19:18 Since it comes that it's hard to you, I suggest you write it 13:19:18 in C, Pascal, Python, or other algoloid language first, 13:19:22 then translate it into Forth. 13:19:46 I've done that before. 13:20:17 E.g. introduce "void swap(int*, int*)" and write it using the latter. 13:20:28 Get it working. 13:32:30 huh 13:32:52 yes, done that too 13:50:57 --- quit: MayDaniel (Read error: Connection reset by peer) 13:52:34 thanks for help though 13:52:38 :-) 14:27:24 got it working? 14:31:21 nop :-/ 14:34:31 Alright, can you write in C the routine you'd like to have in Forth? 14:34:43 sure 14:34:58 Do it, make it work, and paste the result. 14:35:19 I've got it in ada too, generic 14:35:35 but hold on 14:35:43 Well... That's more distant. 15:04:26 damn stray errors.. I don't get how this happens 15:10:09 --- quit: truefx (Ping timeout: 240 seconds) 15:20:06 using UTF-8 too.. 15:20:34 anyways 15:20:37 http://pastebin.com/2gEsNPCu 15:20:41 works as intended 15:21:14 not much of a "novel" or masterpiece but. 15:26:51 --- join: truefx (~hasan@88.250.93.191) joined #forth 15:27:23 what is the function of - " - in ." .......... " ? 15:27:29 second " ? 15:27:37 its not a word then what ? 15:27:44 for compiler 15:36:34 It's just a delimiter. 15:36:54 xpololz: alright, now try to traslate that into Forth directly. 15:37:01 xpololz: without changing algorithm. 15:37:14 its not separated by space 15:37:34 why ? 15:37:58 Because it should incorporate spaces in between. 15:38:07 ." like this" 15:38:24 ." and like this " 15:40:35 ASau, well, I used same source when I implemented both the forth version and C version -- my head. 15:40:46 so to me it looks pretty much like the same. 15:40:51 That doesn't tell anything. 15:41:26 I mean I pretty much see a direct translation. 15:41:35 from what I've already done in Forth and the C code. 15:42:12 By the way, do you see that you can move declaration of j inside loop? 15:42:39 yes I see that. 15:42:48 --- quit: Snoopy_1611 () 15:42:59 Do it then :) 15:43:21 Next. 15:43:23 int j = i; ? 15:43:28 Right. 15:43:32 Next. 15:43:42 Pass -Wconversion to your cc. 15:43:51 You will be surprised. 15:45:25 hmm, howcome? 15:45:37 --- join: Snoopy_1611 (Snoopy_161@dslb-088-069-146-225.pools.arcor-ip.net) joined #forth 15:48:41 Have you run it? 15:48:49 yeah 15:48:52 no difference though 15:49:04 cc --version? 15:49:17 4.6.1 15:49:39 Add -Wall -Wextra too. 15:50:11 still nothing 15:50:20 except warning unused argc and argv.. :-) 15:51:50 l00n1x? 15:51:56 y 15:52:10 Alright, they can break anything. 15:52:32 What is the type of this expression "numbers[i]"? 15:52:52 pointer to integer ? 15:53:01 Really? 15:53:03 Why? 15:53:17 integer* :-) 15:53:22 Wrong. 15:53:40 Go and think. 15:54:18 When you find right answer, you'll understand why Forth sucks. 15:55:41 well, it's.. a memory cell.. 15:55:59 it's referring to the content's of a memory cell. 15:56:17 which is of type integer. 15:56:19 The question is about the type of the expression, no more, no less. 15:56:35 I don't need semantics. 15:57:54 type_of_expr ::= ???? 15:58:04 ? | ? | ? 16:01:19 Yes, exactly. 16:01:29 What is the type of the said expression? 16:03:50 Also, I seriously doubt that you did run "cc -Wconversion" on your file. 16:04:28 howcome? 16:05:06 Because I know what the behaviour is. 16:05:26 why would I not do it? 16:05:40 Did you or did you not? 16:05:46 I did. 16:05:46 Run it and see. 16:05:59 It produces more than 2 warnings. 16:06:24 Or better, it produces exactly one warning, if you don't add -Wall -Wextra. 16:06:41 I don't get that warning. 16:07:09 Then you should go and find non-broken compiler. 16:09:20 Just for the record, you either lie or use broken compiler. 16:09:20 In reality you see something this: 16:09:23 cc -Wconversion -o /tmp/xpololz /tmp/xpololz.c 16:09:23 /tmp/xpololz.c: In function 'sort': 16:09:23 /tmp/xpololz.c:33:27: warning: comparison between pointer and integer 16:09:50 Now go and think what the type of expression "numbers[i]" is. 16:10:11 oh, actually 16:10:15 neither of those. 16:10:42 I edited that part. 16:12:20 Then you're on your own. 16:12:49 and btw, I'm into forth for no other reason than the paradigm.. 16:13:21 Forth uses imperative paradigm, it doesn't differ from C in this respect. 16:14:49 oh well, it's not a paradigm in your eyes, fair enough. I'm into it because I want to learn about stack machines.. 16:16:37 Forth is wrong approach to stack machines. 16:18:30 okay .. ? 16:28:32 --- join: karswell (~coat@93-97-29-243.zone5.bethere.co.uk) joined #forth 16:31:10 anyways, I believe the expression is a pointer to an integer because it can be dereferenced. 16:32:05 I'm not going to discuss code you're the only one to see. 16:33:54 ? 16:34:08 I edited that part. 16:34:37 -.- 16:34:49 If you are incapable of discussing the code you publish yourself, 16:34:55 there's no point to continue. 16:35:03 I'm obviously referring to the code I published. 16:35:38 though it's no big difference between the edited part and the published. 16:35:41 but nevermind. 16:36:21 There's big difference. 16:36:38 Published code is incorrect and compiler diagnoses it. 16:37:32 And you talk about the code after you changed it. 16:37:47 What the changes are exactly is unknown. 16:37:47 --- quit: karswell (Ping timeout: 240 seconds) 16:38:08 that was a glip. I don't know why it happened. 16:38:26 also when I published it, I told you it was no masterpiece. 16:38:43 I was asking for some help because I couldn't get the Forth code working. 16:39:15 I made that C code in order to show you semantics of the Forth code (I thought). 16:39:22 That doesn't mean that I should talk about code that is different from what you're talking about. 16:39:24 what I wanted it to do. 16:39:36 no it doesn't. 16:39:45 It's not an excuse. 16:40:11 And I asked you to write code in C, not to illustrate algorithm. 16:40:37 If you cannot understand what you're asked for, there's no point to continue conversation. 16:40:43 well, I missunderstood that part. was C syntax and compiled by a C compiler. 16:40:58 so there's no point, ok. 16:50:09 --- quit: truefx (Read error: Connection reset by peer) 16:52:12 --- quit: Fox78 (Remote host closed the connection) 16:53:12 --- join: Fox78 (~fox@123.118.158.161) joined #forth 17:04:44 --- join: truefx (~hasan@88.250.93.191) joined #forth 18:00:27 --- join: ttmrichter (~ttmrichte@122.225.105.253) joined #forth 18:12:33 --- quit: nighty- (Read error: Operation timed out) 18:34:49 how can i detect and display keys pressed in other applications ? like a keylogger ? 18:39:23 How can you do that in any other language? 18:48:04 --- quit: truefx (Read error: Connection reset by peer) 19:27:59 --- quit: Snoopy_1611 () 19:51:39 --- join: nighty___ (~nighty@69-165-220-105.dsl.teksavvy.com) joined #forth 19:56:30 --- join: cwardell (~cwardell@pool-108-5-120-252.nwrknj.fios.verizon.net) joined #forth 20:17:51 --- quit: nighty___ (Quit: leaving) 20:22:38 --- join: Snoopy_1611 (Snoopy_161@dslb-178-004-069-250.pools.arcor-ip.net) joined #forth 20:43:11 --- join: nighty___ (~nighty@69-165-220-105.dsl.teksavvy.com) joined #forth 21:10:39 --- join: truefx (~hasan@88.250.93.191) joined #forth 21:55:52 --- quit: nighty___ (Quit: leaving) 23:18:27 --- join: karswell (~coat@93-97-29-243.zone5.bethere.co.uk) joined #forth 23:59:59 --- log: ended forth/11.12.21