exercism / exercism/problem-specifications

[Forth] "using the then-current version of those previously-defined words" issues

オープン
#1,800 コメント 5 件 リアクション 2 件 担当者 0 名 GitHub で見る
主要言語
Ruby
スター
358
フォーク
563
平均マージ
18時間 41分
マージ済み PR(30日)
2

説明

Ref:

- https://github.com/exercism/problem-specifications/commit/c85397312197906905c295ec7d026e53159d2fd4
- https://github.com/exercism/javascript/commit/5954afe66327540918af4cf725a881c5d8adef09

**Context:** Trying to solve/implement this exercise for the Wren track and getting very confused.

I wonder if we should have added this without additional instructions describing for proper behavior. I find the current tests lacking in that they do not give me enough a picture of the correct behavior. I imagine students could make them pass while still having all sorts of bugs that don't actually implement Forth.

Take the JS canonical implementation for example: it is doing "immediate evaluation"... is that correct? _I'm pretty sure that simply defining a function should not execute it._ Also it seems to not deal with the fact that the function in question could remove items from the stack, not just add them... it could also theoretically work with items already on the stack (passed arguments?) making evaluating it immediately **impossible** (you need the future stack, not the present stack). ...or what if the function references another function that's not defined yet? I see we have a `try` catch (perhaps to handle _some_ of these many edge cases) but that just confirms my suspicions that we're probably handling this improperly (and likely need more far more tests).

I'm _guessing_ that is not what Fortran is doing [immediate eval]... _it feels more like closures_ (at a glance).. where a function definition closes on any other function definitions as they stood at the time the function is defined... so calling them later *should* run the actual function (with any side effects it might have) - BUT the function as it stood at the time the callee was defined, not however it might stand now. _But that's just my educated guess._ 🤷🏻‍♂️

- Are we wanting this exercise to truly be so complex?
- Have I properly understood what Fortran actually does here or is it something else?
- Am I entirely off the track here?

CC @slaymance @Disasm

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。