dave0 has quit [Quit: dave's not here]
jedb has quit [Ping timeout: 260 seconds]
<neuro_sys> "Rather than link each entry to its physical predecessor, link it to a predecessor in one of a number of chains. Scramble the word to determine which chain it belongs in, both when you enter it and when you search for it"
<neuro_sys> Does Chuck Moore talk about using a hash table here?
jedb__ has joined #forth
<Zarutian_HTC> assume nothing. How Chuck describes stuff might not have exact translation in usual comp sci terms
jedb_ has quit [Ping timeout: 272 seconds]
<Zarutian_HTC> many people are too prone to do what I call noospheric snap-to
jedb__ is now known as jedb
<Zarutian_HTC> that is, they see a description of a concept and they think it is symonymus with a closely related but distinct concept they already know
<neuro_sys> I see what you mean
<Zarutian_HTC> what Chuck is describing might be something new or at least something that overlapps something well known
<neuro_sys> "noospheric snap-to" is a nice way to put it
<Zarutian_HTC> but looking at what he describes can be a source of inspiration of a diffrent view on these things
<neuro_sys> "It is a futile exercise to attempt to establish a universal set of nouns. Compiler languages have repeatedly stumbled by not providing enough, and no matter how many they provide, someone will want one more."
<neuro_sys> It makes me think of the latest C++ features and proposals.
jimt[m] has quit [Ping timeout: 246 seconds]
jimt[m] has joined #forth
Zarutian_HTC has quit [Remote host closed the connection]
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
Gromboli has quit [Read error: Connection reset by peer]
gravicappa has joined #forth
sts-q has quit [Ping timeout: 272 seconds]
sts-q has joined #forth
hosewiejacke has joined #forth
dddddd has quit [Ping timeout: 246 seconds]
xek has joined #forth
gravicappa has quit [Ping timeout: 265 seconds]
gravicappa has joined #forth
gravicappa has quit [Ping timeout: 260 seconds]
gravicappa has joined #forth
dave0 has joined #forth
gravicappa has quit [Ping timeout: 246 seconds]
gravicappa has joined #forth
hosewiejacke has quit [Ping timeout: 256 seconds]
hosewiejacke has joined #forth
<neuro_sys> I have a begin-while-repeat loop, and I'd like to do short-circuit evaluation in the while condition. I've read about Wil Baden's conditionals, but meanwhile I'm thinking to myself, maybe I should un-learn the short-circuit idea and think differently.
<cmtptr> put the condition in its own word which returns early to short-circuit?
<neuro_sys> "returns early", does this involve some return stack manipulation?
Gromboli has joined #forth
<cmtptr> no, just : condition? first-test if true exit then second-test if true exit then third-test if true exit then false ;
dddddd has joined #forth
<cmtptr> (assuming what you want is a logical OR)
<neuro_sys> Ah I see
<neuro_sys> I'm doing Advent of Code 2020 to learn some Forth, here's my day 1.0 solution for a naive way to solve the problem of given N numbers, find the pair whose sum is equal to 2020, and multiply them: https://gist.github.com/neuro-sys/3197152e07b1dd95c85ad9245a6588d5
<neuro_sys> Any comments on it to improve?
<neuro_sys> I'll try doing it different ways until I get more comfortable
dave0 has quit [Quit: dave's not here]
<cmtptr> i'll let someone more experienced respond. i would say it looks pretty much how most of my forth turns out (except i tend to have less newlines)
<cmtptr> (also isn't there a cell+ word?)
<neuro_sys> Ah right cell+ is better
hosewiejacke has quit [Ping timeout: 240 seconds]
hosewiejacke has joined #forth
<cmtptr> what forth are you using, by the way? gforth?
<neuro_sys> Yes, but I'm trying to keep it minimal for now
<neuro_sys> For instance, not resorting to local variables
<cmtptr> i should just install and play with gforth already
<neuro_sys> It is convenient and the documentation is nice. But I can't compare to any other.
<neuro_sys> Oh that stack juggling I did was not needed. Now I updated the gist with a simpler version.
the_cuckoo has quit [Quit: WeeChat 1.9.1]
the_cuckoo has joined #forth
<neuro_sys> Hmm, puzzled by >NUMBER in gforth. 0 S" 123" >NUMBER fails. Seems like it expects 4 cells in the stack.
gravicappa has quit [Ping timeout: 272 seconds]
<neuro_sys> I wrote this word definition to load a text file containing numbers delimited by new line, and store them in a dictionary entry like this: https://gist.github.com/neuro-sys/3f0cef186e881ea33525b7332d9d3512
<neuro_sys> I wonder how I can put the last line into a definition.
<neuro_sys> Ah I got it.
<hosewiejacke> Forgot the length after S" 123" ?
<neuro_sys> (I updated the gist for my previous question after I figured it out)
<neuro_sys> hosewiejacke: Hmm, let me check
<neuro_sys> S" 123" leaves ( c-addr u ) on the stack, so I'm not sure
<hosewiejacke> Oh yes, my bad.
<cmtptr> i think >number wants a base below the string
<cmtptr> nevermind i misread
<cmtptr> seems like it wants an initial value
<cmtptr> 0 S" 123" >NUMBER
<cmtptr> i don't know a double means in this context or whether 0 counts, sorry
<cmtptr> (i.e. does that mean dword, or does it mean two cells, or does it mean double-length floating point?)
<neuro_sys> Oh it's a double
<neuro_sys> I missed that. So the first value which is an accumulator should be 2cell
<neuro_sys> 0. S" 123" >NUMBER \ indeed works
<hosewiejacke> The Forth Programmer's Handbook says it wants an unsigned, double-precision integer.
hosewiejacke has quit [Ping timeout: 246 seconds]
tangentstorm has quit [Changing host]
tangentstorm has joined #forth
_whitelogger has joined #forth
gravicappa has joined #forth
hosewiejacke has joined #forth
hosewiejacke has quit [Ping timeout: 260 seconds]
gravicappa has quit [Ping timeout: 260 seconds]
jn__ has quit [Quit: No Ping reply in 180 seconds.]
jn__ has joined #forth
cantstanya has joined #forth
xek has quit [Remote host closed the connection]
proteusguy has quit [Ping timeout: 265 seconds]
proteusguy has joined #forth
proteusguy has quit [Ping timeout: 260 seconds]
tolja has quit [Ping timeout: 256 seconds]
tolja has joined #forth
<neuro_sys> Is there a nice way to prevent including the same file more than once? I think I should set a flag and check that.
<neuro_sys> I re-implemented my solution to use linked list instead: https://gist.github.com/neuro-sys/81628d981b229ae576976ae88538ff0b
xek has joined #forth
xek has quit [Client Quit]
proteusguy has joined #forth
xek has joined #forth
xek has quit [Remote host closed the connection]
<inode> neuro_sys: use REQUIRE instead of INCLUDE
<neuro_sys> inode: Thanks
<inode> check "5.17.1 Forth source files" for more info
<neuro_sys> Will do