[Bug]: Iterator of the for loop is treated as an object in get_code_dependency
まだ誰も着手していません。
評価
調査の方向性
報告に記載された R の例を再現し、報告で言及されている get_code_dependency/get_code エントリーポイントから開始します。for ループのイテレーター x が依存関係として記録される仕組みを追跡し、その後、get_code(q, names = 'x') が一時的なループオブジェクトを抽出しなくなり、x <- 5 は保持されることを確認します。
索引モデルが issue の本文から書いたものです。
説明
If object is treated as an iterator in a for loop, like x below, then get_code treats this case as this object created in this for loop, hence even though it's a temporary object (just for the time of the for loop execution) it gets extracted in the get_code
library(teal.code)
q <- within(qenv(), {
a <- 1
b <- 2
}) |> within({
for (x in c(1, 2)) {
b <- a
b <- b + a + 1
b + 3 -> b
}
}) |> within({
x <- 5
})
get_code(q, names = 'x') |> cat()
#> a <- 1
#> b <- 2
#> for (x in c(1, 2)) {
#> b <- a
#> b <- b + a + 1
#> b <- b + 3
#> }
#> x <- 5
Created on 2024-11-27 with reprex v2.1.1
- 主要言語
- R
- スター
- 12
- フォーク
- 11
- 平均マージ
- 8日 15時間
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
insightsengineering/teal.code のほかの issue
-
Move to Pharmaverse対応中かも @llrs-roche が 40 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
insightsengineering/teal.code#292 ·
-
[Feature Request]: High cyclomatic complexity leds to bad readability対応中かも @llrs-roche が 41 日前に担当しました。 オープンenhancement
難易度 3/5 3〜5日 初心者へのやさしさ 45/100
insightsengineering/teal.code#295 ·
-
core discussion
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
insightsengineering/teal.code#291 · コメント 2 件 · リアクション 1 件 ·
-
bug core
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
insightsengineering/teal.code#275 ·
-
bug core
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
insightsengineering/teal.code#272 ·
insightsengineering/teal.code の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
gdsa opencode: keep-alive cleanup trap fails with 'keepalive_pid: unbound variable'対応中かも @darribas が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
sportsdataverse/sportyR#76 ·
メンテナーはふだん 1 日以内に返信