00:00:00 --- log: started retro/17.11.12 03:17:53 how do i use ``split-on-string'' ? say i want the first element of that splitted string ...? 03:28:27 --- quit: mnemnion (Remote host closed the connection) 07:00:11 'Hello_New_World 'New s:split-on-string 07:01:01 after the `s:split-on-string`, the top stack item will be the string "Hello " and the second one "New World" 07:34:55 ah, i see only 2 halfs are possible ,not more? 07:38:35 'Hello:ave ': s:split-on-string 07:38:50 drop 07:39:07 now it should have ave but it has :ave 07:40:07 You'd need to use it repeatedly on the second half. It's not (yet) a tokenizer. 07:40:16 ah, i see. 07:40:23 It splits the string, but doesn't consume the splitting point 07:41:30 thanks for always answering evry question i ever had. I wish more people here would do that other than the 'main guy' :) 07:42:26 no problem 07:44:10 (I'm working on string tokenizing, which would give a set/array, but haven't decided on the best approach for this yet). See examples/TokenizeString.forth for a character based tokenizer; working on substrings is a little more difficult. 07:59:36 You could try: 07:59:44 {{ 07:59:45 'Tokens d:create #1000 allot 07:59:45 'Needle var 07:59:45 ---reveal--- 07:59:45 :s:tokenize-on-string (ss-a) 07:59:45 s:keep !Needle &Tokens buffer:set 07:59:45 [ repeat dup @Needle s:contains-string? 0; drop @Needle s:split-on-string s:keep buffer:add n:inc again ] call 07:59:46 s:keep buffer:add here &Tokens buffer:size dup , [ fetch-next , ] times drop ; 07:59:46 }} 07:59:47 'a:b:cd:e:f: ': s:tokenize-on-string [ s:to-upper puts sp ] set:for-each 08:00:49 (This should work, as long as the source strng doesn't have more than 999 parts) 08:26:10 haha, that won't be the case too soon :) 08:32:23 --- join: mnemnion (~mnemnion@2601:643:8102:7c95:9926:da26:2ce8:d4f0) joined #retro 08:37:08 --- quit: mnemnion (Ping timeout: 252 seconds) 09:33:42 --- join: mnemnion (~mnemnion@2601:643:8102:7c95:9926:da26:2ce8:d4f0) joined #retro 09:38:12 --- quit: mnemnion (Ping timeout: 252 seconds) 10:22:24 what is {{ ? 10:22:33 and }} 10:30:15 Along with ---reveal---, they allow hiding definitions that are used to define one or more larger words 10:31:40 names after {{ and before ---reveal--- are hidden after }} is executed 10:33:29 So in the code I pasted above, Tokens and Needle will be hidden from the dictionary while s:tokenize-on-string will remain visible 11:34:56 --- join: mnemnion (~mnemnion@2601:643:8102:7c95:9926:da26:2ce8:d4f0) joined #retro 11:38:48 --- quit: mnemnion (Remote host closed the connection) 11:39:01 --- join: mnemnion (~mnemnion@2601:643:8102:7c95:9926:da26:2ce8:d4f0) joined #retro 12:08:29 thank you! i think, i need some more experience to get it. 23:03:43 --- quit: FreeFull () 23:59:59 --- log: ended retro/17.11.12