Factor Track Feedback

The recursion learning exercise says that ‘the recursive modifier’ can be added to a word if the compiler has trouble inferring the stack effect.

The term for a word like recursive that trails a word definition is a compiler declaration. The compiler never has trouble inferring stack effects. recursive is simply a requirement for any inline word that calls itself. Commonly this means any recursive word that takes a quotation and calls it. This is how words like map and each are ultimately defined.

2 Likes

I am not sure how easy this is to fix or if I am doing something wrong, but the error reporting is currently pretty bad. I just see an error like this:
T{ slice-error { from 0 } { to -1 } { seq { } } } with no line numbers, no context, nothing.

1 Like

Can you share your code so we can reproduce the error.

A minimal reproducible example:

: exchange-money ( budget exchange-rate -- exchanged )
    2drop f rest ;

This error you saw is what the compiler actually produces, it is a word.

exchange-money takes 2 values on the stack. You drop those 2 values with 2drop, then push f and use rest, which expects a sequence, drops its first element and returns its tail.

rest is partial, it errors on an empty sequence, which is the case with f.

1 Like

:) Yes I am aware, I specifically made this simple example to produce a simple error. The specific error is not the problem (nor is it the actual error that prompted me to post here), the problem is that the error is displayed without any additional information, making it hard to track down where it came from.

For example, running a simple program with an error on my CLI locally, I get a stack trace, telling me that the problem originated from a word called bla :

Cannot create slice: from > to
from 1
to   0
seq  f

(U) [ c-to-factor => ]
    c-to-factor
(U) [ [ (get-catchstack) push ] dip call => (get-catchstack) pop* ]
(O) command-line-startup
(O) run-script
(O) bla
(O) subseq-as
(O) slice-error
(O) M\ object throw
(U) [
        OBJ-CURRENT-THREAD special-object error-thread set-global
        current-continuation => error-continuation set-global
        [ original-error set-global ] [ rethrow ] bi
    ]

I would like the error reporting on here to provide some similar information.

2 Likes

“Purser’s Pantry” says:

The original inventory should not be modified.

return a new inventory

but returning input updated in place passes the tests.

Also regarding “Purser’s Pantry”:

Unlike arrays, hashtables are mutable

But arrays are mutable, as was already fixed in some other task descriptions

1 Like

In “Signaler’s Satchel” the description of Task 4 has some messed up markdown, inverting code and text for a short section

1 Like

I’m not seeing it. Can you create a PR. The descriptions are in .docs

I see it too. The problem is not in the initial description of the task; only once the editor has been opened.

Screenshot 2026-06-25 101033

1 Like

Thanks. Now fixed.

1 Like

The Binary Search exercise can be completed by submitting a blank or incorrect program.

Exercism’s binary-search/binary-search-tests.factor is not being run, as Factor has a test suite with the same name.

I am thinking the best way forward is to deprecate the exercise, so it becomes unavailable to students who haven’t already started it.

Would anyone be interested in creating a PR? We would need "status": "deprecated" in the root config.json , like the accumulate exercise already has.

Then run

bin/fetch-configlet
bin/configlet fmt -u
bin/configlet lint

Another option:

Rename binary-search to binary-chop or something like that. Delete the .meta/generator.jl

Note this breaks the connection with the canonical problem specification, so any future introduction changes or new test cases would need to be synced manually.

4 posts were split to a new topic: Add configlet support to renaming exercise slugs while keeping them linked to the specs

The Grade School exercise is confusing. The tests are doing something uncharacteristically clever that makes it hard to tell what is expected, and the task description is vague.

It’s the only exercise that I have trouble understanding.

PR 291 clarifies what is expected for this track.

1 Like

Signal Stencils has an example:

CONSTANT: build-time << now >>

but it gives an error, should be

CONSTANT: build-time << now suffix! >>

or

CONSTANT: build-time $ now

Changing to $[ now ] in PR 292, and adding a link to Interpolating code results into literal values

1 Like