00:00:00 --- log: started forth/19.06.08 00:34:25 --- join: dys (~dys@tmo-108-200.customers.d1-online.com) joined #forth 02:04:01 --- quit: ashirase (Ping timeout: 246 seconds) 02:08:54 --- join: ashirase (~ashirase@modemcable098.166-22-96.mc.videotron.ca) joined #forth 02:40:02 --- quit: rdrop-exit (Quit: Lost terminal) 02:55:09 --- quit: rpcope- (Ping timeout: 268 seconds) 03:00:40 --- join: rpcope (~GOTZNC@muon.copesystems.com) joined #forth 04:40:46 --- join: dddddd (~dddddd@unaffiliated/dddddd) joined #forth 04:51:57 --- join: X-Scale (~ARM@167.247.28.37.rev.vodafone.pt) joined #forth 07:26:24 --- quit: dys (Ping timeout: 248 seconds) 08:18:10 --- join: dys (~dys@tmo-108-200.customers.d1-online.com) joined #forth 08:50:49 https://www.youtube.com/watch?v=7IgF6_jVaj8 08:57:04 --- quit: tabemann (Ping timeout: 248 seconds) 09:16:57 --- quit: proteusguy (Ping timeout: 272 seconds) 09:41:25 --- join: proteusguy (~proteusgu@cm-58-10-154-77.revip7.asianet.co.th) joined #forth 09:41:25 --- mode: ChanServ set +v proteusguy 10:20:28 --- join: tabemann (~travisb@2600:1700:7990:24e0:b80c:b742:8944:c878) joined #forth 13:49:09 --- quit: cantstanya (Remote host closed the connection) 13:51:32 --- join: cantstanya (~chatting@gateway/tor-sasl/cantstanya) joined #forth 14:40:43 --- join: cnidario (~aaa@92.57.58.87) joined #forth 15:35:31 --- quit: cnidario (Remote host closed the connection) 15:36:08 --- join: dave0 (~dave0@069.d.003.ncl.iprimus.net.au) joined #forth 15:37:57 hi 16:38:23 --- quit: john_metcalf (Ping timeout: 272 seconds) 16:47:26 --- quit: john_cephalopoda (Ping timeout: 252 seconds) 17:00:53 --- join: john_cephalopoda (~john@unaffiliated/john-cephalopoda/x-6407167) joined #forth 17:45:14 --- quit: dne (Remote host closed the connection) 17:45:34 --- join: dne (~dne@jaune.mayonnaise.net) joined #forth 18:18:11 --- join: TheBlueWizard (477eb1c0@gateway/web/freenode/ip.71.126.177.192) joined #forth 18:53:52 --- quit: dave0 (Quit: dave's not here) 19:57:40 --- quit: chunkypuffs (Remote host closed the connection) 20:02:15 --- join: chunkypuffs (~chunkypuf@2a01:4f9:2b:16d5::1) joined #forth 20:03:46 --- quit: chunkypuffs (Remote host closed the connection) 20:08:38 --- join: dave0 (~dave0@069.d.003.ncl.iprimus.net.au) joined #forth 20:09:13 re 20:10:20 --- join: chunkypuffs (~chunkypuf@2a01:4f9:2b:16d5::1) joined #forth 20:18:40 --- quit: chunkypuffs (Remote host closed the connection) 20:21:38 --- join: chunkypuffs (~chunkypuf@2a01:4f9:2b:16d5::1) joined #forth 20:23:35 --- quit: chunkypuffs (Remote host closed the connection) 20:24:49 --- join: chunkypuffs (~chunkypuf@2a01:4f9:2b:16d5::1) joined #forth 20:28:56 --- quit: chunkypuffs (Remote host closed the connection) 20:31:18 --- join: chunkypuffs (~chunkypuf@static.203.112.216.95.clients.your-server.de) joined #forth 20:45:22 --- quit: chunkypuffs (Remote host closed the connection) 20:46:41 --- join: chunkypuffs (~chunkypuf@2a01:4f9:2b:16d5::1) joined #forth 20:50:41 --- quit: chunkypuffs (Remote host closed the connection) 20:52:35 --- join: chunkypuffs (~chunkypuf@2a01:4f9:2b:16d5::1) joined #forth 21:03:56 --- quit: chunkypuffs (Remote host closed the connection) 21:06:44 --- join: chunkypuffs (~chunkypuf@2a01:4f9:2b:16d5::1) joined #forth 21:14:40 --- quit: chunkypuffs (Read error: Connection reset by peer) 21:16:32 --- join: chunkypuffs (~chunkypuf@2a01:4f9:2b:16d5::1) joined #forth 21:17:46 --- quit: chunkypuffs (Remote host closed the connection) 21:20:18 --- join: Fex (~Fex@47.137.245.208) joined #forth 21:20:29 --- join: chunkypuffs (~chunkypuf@2a01:4f9:2b:16d5::1) joined #forth 21:22:03 I was wondering, if there was a substr word (getting substring of a string) what would be preferred for parameter order? substr ( string start_index end_index -- string_substring ) 21:22:11 that's what I had in minde 21:23:38 or maybe do something like JS where substring uses start index and end index, and substr uses start index and length? 21:24:31 hmm, but that still doesn't take care of the parameter order 21:24:31 --- quit: chunkypuffs (Remote host closed the connection) 21:25:26 well, ( addr len start end -- addr' len' ) has a nice simple implementation: : substr over - >r nip + r> ; 21:25:37 for some definition of 'simple'. 21:26:03 (bounds checking is of course to be added if it is deemed necessary) 21:27:15 --- join: chunkypuffs (~chunkypuf@2a01:4f9:2b:16d5::1) joined #forth 21:28:19 --- quit: chunkypuffs (Remote host closed the connection) 21:28:22 reepca, I should have clarified, I'm working on a special implementation of forth where the string is an object type 21:28:41 so addr is actuall a string object, there is no need for len 21:28:54 but start followed by end is what I had in mind 21:29:45 --- join: chunkypuffs (~chunkypuf@static.203.112.216.95.clients.your-server.de) joined #forth 21:30:28 Fex: one of the adjustments I find myself needing to make in forth is getting rid of optional arguments. For example, in common lisp, a substring function would normally by default copy the entire string, unless you specified a start, in which case it would copy from the start to the end, unless you also specified an end, in which case it would do the obvious thing. 21:31:57 in my implementation, there are no optional parameters, everything takes in all of the defined parameters for a word 21:32:32 But it sort of forces good factoring in a way. For example, if you prefix your string words with $ like gforth does, you could have $from and $until for the other cases. 21:32:58 s" cat food" 4 $from type => food 21:34:58 (although with 2-cell strings $from would be equivalent to the ans forth word /string) 21:37:14 --- quit: chunkypuffs (Remote host closed the connection) 21:37:35 i like how strings are c-addr len 21:38:50 i don't like the c strings that are NIL terminated :-) 21:39:43 counted strings i think they're called 21:40:28 yeah, in my case I'm going with whatever string type C# uses, that's what I'm implementing my custom forth vm in 21:40:46 but I'm trying to make it kind of more like modern languages like python or js 21:40:52 So it's really just an issue of what's more convenient for the caller, then? 21:41:02 pretty much 21:41:20 but I can reorder the parameters in the actual implementation of the word 21:41:35 so I'm really trying to make it more convenient for the users 21:42:29 dave0, in my implementation you just do something like this: " hello world" . 21:42:40 that would make a string and print it out 21:42:54 cool 21:42:55 or you could do ." hello world" (like in regular forth) if the string is static 21:43:02 . knows it's a string? 21:43:14 yeah, . will be one of those smart words 21:43:28 since everything is an object, everything has a flag denoting the value type 21:43:42 well, I guess we'd have to start speculating about common use cases. I'd expect that the string would be obtained first, and the bounds would be obtained after that (usually based on that, for example by searching for delimiters) 21:45:43 yeah, the reason I went with ( string start end -- substring) is that you can make a word called getfirst4chars and there wouldn't have to be any swapping 21:45:57 just : getfirst4chars 0 4 substr ; 21:47:09 that was the same reasoning behind zy]x[yz's idea for the order of the set word for dictionaries 21:48:07 --- part: TheBlueWizard left #forth 21:48:27 with start/end you need to know if it's exclusive or inclusive 21:48:50 how do you mean? 21:49:31 is 4 4 substr 1 character long or 0 ? 21:49:39 hmm 21:50:16 I think I'm going to go with substr using ( string start_index max_length -- substring ), so it would be 4 chars 21:50:29 but I get what you're saying (just replace substr with substring in your example) 21:50:45 I guess I should check to see what C# does 21:51:14 the usual practice I've seen is for the low index to be inclusive and the high index to be exclusive. So 4 5 substr would be 1 character long. By induction, 4 4 substr should be 0 characters long. 21:51:16 i think i will wikipedia C# :-) 21:51:55 (although I'm not sure if [4, 4) is even valid mathematical syntax) 22:11:32 reepca, that makes sense since the indexes seem to be between characters and not the characters themselves 22:11:56 like 4 5 |h|e|l|l|o| would be from the 4th | to the 5th | 22:13:14 I'm also gonna add negative indices since I like them in python and miss them in js 22:41:06 --- join: chunkypuffs (~chunkypuf@2a01:4f9:2b:16d5::1) joined #forth 23:00:15 --- part: Fex left #forth 23:00:26 --- quit: chunkypuffs (Quit: ZNC 1.7.1 - https://znc.in) 23:05:37 --- join: chunkypuffs (~chunkypuf@static.203.112.216.95.clients.your-server.de) joined #forth 23:20:22 why wouldn't you do substr ( string, start_pos, len -- substring )? substr would then grab, at most, 'len' characters starting at position 'start_pos'. This also allows for negative or reverse direction if you desired such a capability. I think the bounds checking is safer and easier with this specification Fex. 23:44:42 --- quit: chunkypuffs (Remote host closed the connection) 23:45:50 --- join: chunkypuffs (~chunkypuf@2a01:4f9:2b:16d5::1) joined #forth 23:59:59 --- log: ended forth/19.06.08