00:00:00 --- log: started forth/16.10.18 00:21:48 --- quit: fiddlerwoaroof (Ping timeout: 258 seconds) 00:33:37 Can I store a word on the stack? 00:33:42 besides a number? 00:35:53 It is just that I have only ever stored numbers on the stack, and that bools also seem to be numbers 00:36:01 and so I am wondering if it's only numbers that I can pass around 00:36:11 --- join: fiddlerwoaroof (~fiddlerwo@unaffiliated/fiddlerwoaroof) joined #forth 00:41:42 --- quit: lucasaiu (Quit: ERC (IRC client for Emacs 25.1.50.2)) 00:41:45 I haven't really encountered anything relating to strings or any other datatypes besides numbers except when I ." print a string like this" 00:47:06 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 00:52:26 --- quit: mnemnion (Ping timeout: 250 seconds) 00:52:33 --- quit: fiddlerwoaroof (Ping timeout: 256 seconds) 01:07:20 --- join: fiddlerwoaroof (~fiddlerwo@unaffiliated/fiddlerwoaroof) joined #forth 01:45:55 --- join: lucasaiu (~user@fsf/member/lucasaiu) joined #forth 01:49:33 --- join: mnemnion (~mnemnion@2601:643:8102:7c95:9981:6f29:a1d3:5517) joined #forth 01:54:11 --- quit: mnemnion (Ping timeout: 245 seconds) 02:36:37 --- join: proteusguy (~proteusgu@58.137.143.226) joined #forth 02:36:37 --- mode: ChanServ set +v proteusguy 02:50:16 --- join: mnemnion (~mnemnion@2601:643:8102:7c95:9981:6f29:a1d3:5517) joined #forth 02:54:35 --- quit: mnemnion (Ping timeout: 245 seconds) 02:57:30 --- quit: mark4 (Ping timeout: 245 seconds) 02:58:59 --- quit: proteusguy (Read error: Connection reset by peer) 03:06:29 --- quit: nighty (Quit: Disappears in a puff of smoke) 03:37:12 --- join: timeslice (~photon@2001:8003:f114:df00:260a:64ff:fe69:d6a9) joined #forth 03:53:57 --- join: proteusguy (~proteusgu@14.207.44.136) joined #forth 03:53:57 --- mode: ChanServ set +v proteusguy 04:00:38 --- join: nighty (~nighty@s229123.ppp.asahi-net.or.jp) joined #forth 04:02:47 --- join: true-grue (~true-grue@176.14.222.10) joined #forth 04:18:10 --- quit: proteusguy (Ping timeout: 260 seconds) 04:18:54 John[Lisbeth]: AFAIK Forth has only one Type, the Cell. 04:19:45 You could make Your own Type System. 04:49:53 --- join: proteusguy (~proteusgu@180.183.140.191) joined #forth 04:49:53 --- mode: ChanServ set +v proteusguy 04:51:49 --- join: mnemnion (~mnemnion@2601:643:8102:7c95:9981:6f29:a1d3:5517) joined #forth 04:56:15 --- quit: mnemnion (Ping timeout: 245 seconds) 05:06:25 --- nick: hexagon51n -> hexagon5un 05:35:53 --- join: rgrinberg (~rgrinberg@blk-212-79-74.eastlink.ca) joined #forth 05:49:51 --- quit: karswell` (Remote host closed the connection) 05:51:19 --- join: karswell` (~user@83.208.208.46.dyn.plus.net) joined #forth 05:52:31 --- join: mnemnion (~mnemnion@2601:643:8102:7c95:9981:6f29:a1d3:5517) joined #forth 05:57:25 --- quit: mnemnion (Ping timeout: 256 seconds) 06:02:26 --- quit: karswell` (Read error: Connection reset by peer) 06:03:49 --- join: karswell` (~user@83.208.208.46.dyn.plus.net) joined #forth 06:26:30 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 06:27:56 --- quit: novavis (Ping timeout: 265 seconds) 07:11:25 --- join: neceve (~ncv@unaffiliated/neceve) joined #forth 08:18:35 --- join: joneshf-laptop (~joneshf@c-73-220-86-28.hsd1.ca.comcast.net) joined #forth 08:40:32 --- join: vsg1990 (~vsg1990@rrcs-72-45-253-82.nys.biz.rr.com) joined #forth 08:40:35 --- quit: vsg1990 (Remote host closed the connection) 08:58:22 --- quit: rgrinberg (Ping timeout: 250 seconds) 08:58:55 --- quit: lucasaiu (Ping timeout: 244 seconds) 09:18:08 --- join: lucasaiu (~user@fsf/member/lucasaiu) joined #forth 09:21:32 --- join: rgrinberg (~rgrinberg@blk-212-79-74.eastlink.ca) joined #forth 10:02:34 --- quit: Guest65714 (Remote host closed the connection) 10:14:26 --- join: mark4 (~mark4@99-164-75-34.lightspeed.rcsntx.sbcglobal.net) joined #forth 10:33:11 John[Lisbeth]: everything is a number until you give it some meaning in your head. Some languages (Haskell, etc) try to give meaning to data through explicit statements about what the data means. Others try to have the data itself say what it means (lisp, python, etc). Forth thinks that the meaning of data is all in your head anyway, so why waste time/space typing it (pun intended) unless it clears things up? A string can be represented 10:33:11 quite a few ways. Unicode (UTF-8, UTF-16, UTF-32?) or ASCII? Null-terminated or counted? The traditional way of representing strings in forth is with a counted string consisting of byte-sized characters. 10:33:30 --- quit: neceve (Quit: Konversation terminated!) 10:33:41 and the typical way of using string literals is with the word s" 10:33:49 --- log: started forth/16.10.18 10:33:49 --- join: clog_ (~nef@bespin.org) joined #forth 10:33:49 --- topic: 'Forth Programming | logged by clog at http://bit.ly/91toWN | http://projects.forthworks.com/standards/DPANS/ | www.greenarraychips.com' 10:33:49 --- topic: set by crc!sid2647@gateway/web/irccloud.com/x-incoycbnpesmfspg on [Fri Nov 06 18:58:45 2015] 10:33:49 --- names: list (clog_ mark4 rgrinberg lucasaiu joneshf-laptop mnemnion karswell` +proteusguy true-grue nighty timeslice fiddlerwoaroof dys M-jimt Keshl__ dograt groovy2shoes beretta John[Lisbeth] impomatic_ bluekelp segher_ reepca Quozl`_ backer_ rprimus_ carc ggherdov`__ DGASAU` eatonphil npr APic jeremyheiler nighty- newcup yunfan phadthai malyn diginet2 hexagon5un _longines pdewacht Vendan taij33n zy]x[yz crc eldre irsol nerfur`) 10:33:54 --- join: dzho_ (~dzho@unaffiliated/dzho) joined #forth 10:34:08 --- join: OriansJ` (~user@107.170.205.175) joined #forth 10:34:15 s" looks for a closing ", just like .", but its runtime-effect is to put the address and the number of characters on the stack. 10:34:18 --- join: pointfree (~pointfree@174.62.81.78) joined #forth 10:34:31 --- join: CORDIC (~user@93-87-111-140.dynamic.isp.telekom.rs) joined #forth 10:34:44 --- join: rpcope (~rpcope@162.245.217.4) joined #forth 10:35:12 And you already know how you could print a string - just loop through and EMIT each character. There's an easier way, though, called TYPE, which takes exactly what s" gives. 10:35:23 --- join: djinni (~djinni@68.ip-149-56-14.net) joined #forth 10:36:21 --- join: cantstanya (~chatting@2001:41d0:8:c6c::1) joined #forth 10:37:12 If you want to store a "word" on the stack, as you say, you might store (an address to a string with the name of the word) and (the number of characters) on the stack. Or you might store an execution token if you just want to be able to run the word. Or you might store some implementation-specific thing, like one of gforth's name-tokens. 10:39:37 to anyone, not just John[Lisbeth]: I've been wondering what would happen if we made it so that a word not recognized as a number or an existing word would simply be put on the stack as a symbol. So we could have the natural ordering for things like VARIABLE. It definitely seems like something we could shoot ourselves in the foot with, but we seem trigger-happy enough already in that department. 10:44:24 --- join: ovf (sid19068@gateway/web/irccloud.com/x-yoifpxaeegutlkmb) joined #forth 10:50:34 --- join: Zarutian (~zarutian@168-110-22-46.fiber.hringdu.is) joined #forth 11:07:25 --- join: mnemnia (~mnemnion@2601:643:8102:7c95:9981:6f29:a1d3:5517) joined #forth 11:09:28 --- quit: mnemnion (Ping timeout: 252 seconds) 11:13:45 --- quit: mnemnia (Ping timeout: 245 seconds) 11:17:22 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 11:36:50 --- join: novavis (~user@host47-41-dynamic.52-79-r.retail.telecomitalia.it) joined #forth 11:38:25 --- quit: novavis (Remote host closed the connection) 11:38:59 --- join: novavis (~user@host47-41-dynamic.52-79-r.retail.telecomitalia.it) joined #forth 11:40:01 --- nick: dzho_ -> dzho 11:40:38 --- quit: novavis (Remote host closed the connection) 11:48:23 --- quit: mnemnion (Ping timeout: 244 seconds) 12:06:31 --- join: mnemnion (~mnemnion@71.198.73.193) joined #forth 12:21:22 --- quit: karswell` (Remote host closed the connection) 12:32:32 --- join: ASau (~user@netbsd/developers/asau) joined #forth 12:53:25 --- join: novavis (~user@host47-41-dynamic.52-79-r.retail.telecomitalia.it) joined #forth 13:02:37 --- join: Mat4 (~claude@ip5b41150c.dynamic.kabel-deutschland.de) joined #forth 13:08:13 --- quit: cantstanya (Quit: WeeChat 1.5) 13:09:15 --- part: Mat4 left #forth 13:11:33 --- join: cantstanya (~chatting@unaffiliated/cantstanya) joined #forth 13:33:28 --- quit: rgrinberg (Remote host closed the connection) 13:45:42 --- join: nal (~nal@adsl-64-237-235-157.prtc.net) joined #forth 14:18:22 --- quit: M-jimt (Ping timeout: 256 seconds) 14:22:22 --- join: M-jimt (jimtmatrix@gateway/shell/matrix.org/x-qlyuxuljcjhuxelj) joined #forth 14:42:06 --- join: rgrinberg (~rgrinberg@blk-212-79-74.eastlink.ca) joined #forth 14:43:45 reepca: How would You define symbol? 14:45:59 I mean I have no idea what You mean by ``symbol''. 15:06:22 --- part: timeslice left #forth 15:08:30 --- quit: nerfur` (Ping timeout: 268 seconds) 15:09:46 --- join: nerfur (~nerfur@mail.freeside.ru) joined #forth 15:22:55 --- quit: nerfur (Ping timeout: 245 seconds) 15:23:24 --- join: nerfur (~nerfur@mail.freeside.ru) joined #forth 15:30:46 --- quit: dys (Ping timeout: 256 seconds) 15:32:57 --- join: nal1 (~nal@adsl-64-237-233-56.prtc.net) joined #forth 15:35:59 --- quit: nal (Ping timeout: 256 seconds) 15:56:12 CORDIC: When I say symbol, I mean some cell-sized value that denotes a word name, but not necessarily the name of a word that is defined. Like a Lisp symbol. Also sort of like gforth's name tokens. 16:03:20 reepca: Why not `Defer'ed words then? 16:04:16 I don't think that a name should be part of Symbol definition. 16:08:36 the idea is to be able to handle names without the overhead of comparing/moving strings around or defining stuff ahead of time 16:09:56 reepca: basically by interning them and just do pointer comparisation later? 16:10:16 Zarutian: yep. 16:10:45 reepca: heard about such a system that used trie to allow for fast interning. 16:11:15 and I'm wondering if it would help to add another fallthrough case where if it's not defined already as a word and it isn't a number then it just puts the pointer on the stack 16:11:26 err, pointer to the interned string, that is 16:12:44 I think by itself it's probably just a hassle, but I'm in the process of trying to put my thoughts together to use a concept like that usefully 16:21:32 --- join: X-Scale (~ARM@2001:0:53aa:64c:0:fbf5:b176:3a49) joined #forth 16:30:39 --- quit: nighty (Quit: Disappears in a puff of smoke) 16:33:56 --- quit: rgrinberg (Remote host closed the connection) 16:35:49 --- join: systemsgotyou (~User@71.91.8.13) joined #forth 16:36:30 --- join: rgrinberg (~rgrinberg@blk-212-79-74.eastlink.ca) joined #forth 16:52:52 --- quit: rgrinberg (Remote host closed the connection) 16:56:17 --- join: rgrinberg (~rgrinberg@blk-212-79-74.eastlink.ca) joined #forth 16:57:13 --- quit: true-grue (Read error: Connection reset by peer) 17:04:26 --- quit: nerfur (Ping timeout: 260 seconds) 17:04:39 --- join: nerfur (~nerfur@mail.freeside.ru) joined #forth 17:18:53 --- join: nighty (~nighty@d246113.ppp.asahi-net.or.jp) joined #forth 17:22:51 --- quit: nal1 (Ping timeout: 265 seconds) 17:40:04 --- quit: Zarutian (Quit: Zarutian) 17:45:40 --- join: nal (~nal@adsl-64-237-237-208.prtc.net) joined #forth 18:15:33 --- quit: systemsgotyou (Read error: Connection reset by peer) 18:31:57 --- quit: rgrinberg (Remote host closed the connection) 18:33:55 --- join: neceve (~ncv@unaffiliated/neceve) joined #forth 18:35:27 --- quit: clog_ (^C) 18:35:27 --- log: stopped forth/16.10.18 18:35:42 --- log: started forth/16.10.18 18:35:42 --- join: clog (~nef@bespin.org) joined #forth 18:35:42 --- topic: 'Forth Programming | logged by clog at http://bit.ly/91toWN | http://projects.forthworks.com/standards/DPANS/ | www.greenarraychips.com' 18:35:42 --- topic: set by crc!sid2647@gateway/web/irccloud.com/x-incoycbnpesmfspg on [Fri Nov 06 18:58:45 2015] 18:35:42 --- names: list (clog neceve nal nighty nerfur X-Scale M-jimt cantstanya novavis ASau mnemnion ovf djinni rpcope CORDIC pointfree OriansJ` dzho mark4 lucasaiu joneshf-laptop +proteusguy fiddlerwoaroof Keshl__ dograt groovy2shoes beretta John[Lisbeth] impomatic_ bluekelp segher_ reepca Quozl`_ backer_ rprimus_ carc ggherdov`__ DGASAU` eatonphil npr APic irsol eldre crc zy]x[yz taij33n Vendan pdewacht _longines hexagon5un diginet2 malyn phadthai yunfan newcup nighty- jeremyheiler) 19:37:21 --- join: moby (~moby@177-177-183-251.user.veloxzone.com.br) joined #forth 19:39:43 --- join: systemsgotyou (~User@71.91.8.13) joined #forth 19:57:00 --- quit: ASau (Remote host closed the connection) 20:43:55 --- quit: joneshf-laptop (Quit: Leaving) 20:57:11 --- quit: impomatic_ (Ping timeout: 252 seconds) 21:03:10 --- quit: moby (Ping timeout: 250 seconds) 21:03:47 --- join: moby (~moby@177-177-183-251.user.veloxzone.com.br) joined #forth 22:14:32 --- quit: proteusguy (Quit: Leaving) 22:42:17 --- join: proteusguy (~proteusgu@14.207.8.32) joined #forth 22:42:17 --- mode: ChanServ set +v proteusguy 22:49:17 --- quit: neceve (Quit: Konversation terminated!) 22:53:18 --- quit: nal (Quit: WeeChat 1.4) 23:48:42 --- join: dys (~dys@x4d02bea4.dyn.telefonica.de) joined #forth 23:59:59 --- log: ended forth/16.10.18