From: Enoch <ix...@ho...> - 2013-03-27 20:59:28
|
Matthias Trute <mt...@we...> writes: > Hi Enoch, > > Only one remark so far. > > You defined the scope stack effect as ( addr len -- addr len wid ) > Usually forth follows the conecpt, that a word consumes its parameters > to generate the new data. I'd prefer to keep this idea as the general > design pattern. That changes scope to the stack effect (addr len -- wid ) > That requires a few more instructions (a 2DUP in (CREATE) and the get-current > needs some glue code to be usable as a scope provider. Nothing really big, I > think. Hello Matthias, You are absolutely correct, Leo Brodie writes in 4.16 "Tip: Let definitions consume their arguments", but I have the feeling that he would have said (*) but you can igone this advice if it adds uncessary cruft to your code :-) (*) Since I don't believe that he would advocate against the KISS principle. > Your scope example turns to something like > > : scope ( addr len -- wid) > drop c@ [char] _ = if > _private > else > get-current > then ; > > (not tested) > > The standard scope provider that uses GET-CURRENT will be > > : current-scope drop drop get-current ; > >> P/S If you approve of this patch I suggest submission of an RfD to >> forth200x.org. > > You're a brave man ;) I think that their standards committee gives too much voice to guys from the PC era while Forth "is born" for the small µC in mind. Regards, Enoch. |