Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

factor: update for Factor 0.98 #605

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ mono ./stepX_YYY.exe

### Factor

The Factor implementation of mal has been tested with Factor 0.97
The Factor implementation of mal has been tested with Factor 0.98
([factorcode.org](http://factorcode.org)).

```
Expand Down
7 changes: 3 additions & 4 deletions impls/factor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ WORKDIR /mal
# Factor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please modify the top of the Dockerfile: change FROM ubuntu:vivid to FROM ubuntu:20.04 (just to modernize the images).

RUN apt-get -y install libgtkglext1
RUN cd /usr/lib/x86_64-linux-gnu/ \
&& curl -O http://downloads.factorcode.org/releases/0.97/factor-linux-x86-64-0.97.tar.gz \
&& tar xvzf factor-linux-x86-64-0.97.tar.gz \
&& curl -O http://downloads.factorcode.org/releases/0.98/factor-linux-x86-64-0.98.tar.gz \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the URL from http:// to https:// .

&& tar xvzf factor-linux-x86-64-0.98.tar.gz \
&& ln -sf /usr/lib/x86_64-linux-gnu/factor/factor /usr/bin/factor \
&& rm factor-linux-x86-64-0.97.tar.gz

&& rm factor-linux-x86-64-0.98.tar.gz
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the following line at the end of Dockefile:


ENV HOME /mal

This will allow factor to create the $HOME/.cache directory.

2 changes: 1 addition & 1 deletion impls/factor/lib/printer/printer.factor
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ lib.types math math.parser sequences splitting strings summary
vectors ;
IN: lib.printer

GENERIC# (pr-str) 1 ( maltype readably? -- str )
GENERIC#: (pr-str) 1 ( maltype readably? -- str )
M: object (pr-str) drop summary ;
M: malatom (pr-str) [ val>> ] dip (pr-str) "(atom " ")" surround ;
M: malfn (pr-str) 2drop "#<fn>" ;
Expand Down
2 changes: 1 addition & 1 deletion impls/factor/step2_eval/step2_eval.factor
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CONSTANT: repl-env H{

DEFER: EVAL

GENERIC# eval-ast 1 ( ast env -- ast )
GENERIC#: eval-ast 1 ( ast env -- ast )
M: malsymbol eval-ast
[ name>> ] dip ?at [ "no variable " prepend throw ] unless ;
M: sequence eval-ast '[ _ EVAL ] map ;
Expand Down
2 changes: 1 addition & 1 deletion impls/factor/step3_env/step3_env.factor
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SYMBOL: repl-env

DEFER: EVAL

GENERIC# eval-ast 1 ( ast env -- ast )
GENERIC#: eval-ast 1 ( ast env -- ast )
M: malsymbol eval-ast env-get ;
M: sequence eval-ast '[ _ EVAL ] map ;
M: assoc eval-ast '[ _ EVAL ] assoc-map ;
Expand Down
2 changes: 1 addition & 1 deletion impls/factor/step4_if_fn_do/step4_if_fn_do.factor
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SYMBOL: repl-env

DEFER: EVAL

GENERIC# eval-ast 1 ( ast env -- ast )
GENERIC#: eval-ast 1 ( ast env -- ast )
M: malsymbol eval-ast env-get ;
M: sequence eval-ast '[ _ EVAL ] map ;
M: assoc eval-ast '[ _ EVAL ] assoc-map ;
Expand Down
2 changes: 1 addition & 1 deletion impls/factor/step5_tco/step5_tco.factor
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SYMBOL: repl-env

DEFER: EVAL

GENERIC# eval-ast 1 ( ast env -- ast )
GENERIC#: eval-ast 1 ( ast env -- ast )
M: malsymbol eval-ast env-get ;
M: sequence eval-ast '[ _ EVAL ] map ;
M: assoc eval-ast '[ _ EVAL ] assoc-map ;
Expand Down
2 changes: 1 addition & 1 deletion impls/factor/step6_file/step6_file.factor
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SYMBOL: repl-env

DEFER: EVAL

GENERIC# eval-ast 1 ( ast env -- ast )
GENERIC#: eval-ast 1 ( ast env -- ast )
M: malsymbol eval-ast env-get ;
M: sequence eval-ast '[ _ EVAL ] map ;
M: assoc eval-ast '[ _ EVAL ] assoc-map ;
Expand Down
2 changes: 1 addition & 1 deletion impls/factor/step7_quote/step7_quote.factor
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SYMBOL: repl-env

DEFER: EVAL

GENERIC# eval-ast 1 ( ast env -- ast )
GENERIC#: eval-ast 1 ( ast env -- ast )
Copy link
Collaborator

@dubek dubek Jan 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

besides this, there's another GENERIC# in line 52 which needs fixing (missing colon). I get an error:

Started with:
../factor/step7_quote/step7_quote.factor

52: GENERIC# apply 0 ( args fn -- maltype newenv/f )
            ^
No word named “GENERIC#” found in current vocabulary search path
(U) Quotation: [ c-to-factor
Testing cons function
TEST: '(cons 1 (list))' -> ['',(1)]
Exception: IOError(5, 'Input/output error')
Output before exception:
]
    Word: c-to-factor
(U) Quotation: [ [ (get-catchstack) push ] dip call => (get-catchstack) pop* ]
(O) Word: command-line-startup
(O) Word: run-script
(O) Word: run-file
(O) Word: parse-file
(O) Word: parse-stream
(O) Word: parse-fresh
(O) Word: (parse-lines)
(O) Word: (parse-until)
(O) Word: parse-until-step
(O) Word: no-word
(O) Word: throw-restarts
(O) Method: M\ object throw
(U) Quotation: [
        OBJ-CURRENT-THREAD special-object error-thread set-global
        current-continuation => error-continuation set-global
        [ original-error set-global ] [ rethrow ] bi
    ]
(cons 1 (list))

make: *** [Makefile:238: test^factor^step7] Error 1

(similarly for steps 8, 9, A)

M: malsymbol eval-ast env-get ;
M: sequence eval-ast '[ _ EVAL ] map ;
M: assoc eval-ast '[ _ EVAL ] assoc-map ;
Expand Down
2 changes: 1 addition & 1 deletion impls/factor/step8_macros/step8_macros.factor
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SYMBOL: repl-env

DEFER: EVAL

GENERIC# eval-ast 1 ( ast env -- ast )
GENERIC#: eval-ast 1 ( ast env -- ast )
M: malsymbol eval-ast env-get ;
M: sequence eval-ast '[ _ EVAL ] map ;
M: assoc eval-ast '[ _ EVAL ] assoc-map ;
Expand Down
2 changes: 1 addition & 1 deletion impls/factor/step9_try/step9_try.factor
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SYMBOL: repl-env

DEFER: EVAL

GENERIC# eval-ast 1 ( ast env -- ast )
GENERIC#: eval-ast 1 ( ast env -- ast )
M: malsymbol eval-ast env-get ;
M: sequence eval-ast '[ _ EVAL ] map ;
M: assoc eval-ast '[ _ EVAL ] assoc-map ;
Expand Down
2 changes: 1 addition & 1 deletion impls/factor/stepA_mal/stepA_mal.factor
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SYMBOL: repl-env

DEFER: EVAL

GENERIC# eval-ast 1 ( ast env -- ast )
GENERIC#: eval-ast 1 ( ast env -- ast )
M: malsymbol eval-ast env-get ;
M: sequence eval-ast '[ _ EVAL ] map ;
M: assoc eval-ast '[ _ EVAL ] assoc-map ;
Expand Down