Skip to content

Restore bare fn package compatibility and add tidyverse/testthat smoke CI #12

Description

@isomorphisms

Problem

IR currently reserves bare fn as a function-constructor spelling. The IR README already notes the consequence: old R code using fn as a variable or argument must be changed.

That is a package-ecosystem compatibility break, not just a cosmetic source change. rlang uses fn in live source code; for example R/trace.R contains a formal named fn (call_trace_context <- function(call, fn)) and assigns to fn inside the function. rlang is foundational for testthat, tibble, dplyr, and the tidyverse.

This matters immediately for translating r-koans into IR: the lessons can be rewritten, but the standard teaching/testing stack should not have to be forked merely to get past the parser.

Preferred invariant

Unmodified R packages should continue to parse and load under IR unless IR intentionally changes their semantics. New IR syntax should be additive where possible.

The smallest compatibility-preserving option appears to be to stop reserving ASCII fn and keep λ / ƒ as the distinctive function-constructor spellings. A more contextual parser is also possible, but the acceptance criterion should be package compatibility rather than a particular implementation.

Add a package smoke gate

Build IR, then install/load unmodified current releases of at least:

  • rlang
  • testthat
  • tibble
  • dplyr

Optionally add the tidyverse meta-package once the smaller gate is reliable.

Then run an upstream testthat test containing IR syntax, for example:

library(testthat)

test_that("IR spellings work inside upstream testthat", {
  answer8 ÷ 2
  expect_true(answer4)
})

Also parse a representative dependency source file that contains a bare fn identifier so this exact regression cannot come back silently.

Why not rewrite testthat first?

Keep upstream testthat unchanged as a compatibility oracle. If we immediately translate/fork the test framework itself, the tests can accidentally hide a language-compatibility defect. IR-native test code can sit on top of upstream testthat once the package stack loads cleanly.

Acceptance criteria

  • unmodified rlang installs and loads under IR
  • unmodified testthat installs and loads under IR
  • unmodified tibble installs and loads under IR
  • unmodified dplyr installs and loads under IR
  • a testthat test written with , ÷, and passes
  • CI contains a regression fixture with a bare identifier/formal named fn
  • the final README states clearly whether ASCII fn remains reserved

Related motivation: translating isomorphisms/r-koans into IR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions