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

The printing style of functions is inconsistent #208

Closed
shhyou opened this issue Oct 31, 2023 · 0 comments · Fixed by #229
Closed

The printing style of functions is inconsistent #208

shhyou opened this issue Oct 31, 2023 · 0 comments · Fixed by #229

Comments

@shhyou
Copy link
Collaborator

shhyou commented Oct 31, 2023

Consider this ISL/lambda program:

(define (my-add1 n) (+ n 1))
my-add1

The output says lambda:

Welcome to DrRacket, version 8.11.0.3 [cs].
Language: Intermediate Student with lambda; memory limit: 1024 MB.
(lambda (a1) ...)

But in the interaction window I got the function name (based on 8a6d349, this is the expected one):

> my-add1
my-add1
shhyou added a commit to shhyou/htdp that referenced this issue Oct 24, 2024
The pconvert-lib printer checks the namespace for (pre-)defined symbols.

If the current namespace is not configured, as what would happen during module
instantiation, user-written functions like my-add1 would be printed differently:

    #lang htdp/isl+
    (define (my-add1 n) (+ n 1))
    my-add1

Output:

    Welcome to DrRacket
    (lambda (a1) ...)
    > my-add1
    my-add1
shhyou added a commit to shhyou/htdp that referenced this issue Oct 24, 2024
The pconvert-lib printer checks the namespace for (pre-)defined symbols.

If the current namespace is not configured, as what would happen during module
instantiation, user-written functions like my-add1 would be printed differently.
This also affects the error message from the check-expects.

    #lang htdp/isl+
    (define (my-add1 n) (+ n 1))
    my-add1
    (check-expect my-add1 2)

Output:

    Welcome to DrRacket.
    (lambda (a1) ...)

    Ran 1 test.
    0 tests passed.

    check-expect ... error ... :: first argument of equality cannot
    be a function, given (lambda (a1) ...)

    > my-add1
    my-add1
shhyou added a commit to shhyou/htdp that referenced this issue Oct 25, 2024
The pconvert-lib printer checks the namespace for (pre-)defined symbols.

If the current namespace is not configured, as what would happen during module
instantiation, user-written functions like my-add1 would be printed differently.
This also affects the error message from the check-expects.

    #lang htdp/isl+
    (define (my-add1 n) (+ n 1))
    my-add1
    (check-expect my-add1 2)

Output:

    Welcome to DrRacket.
    (lambda (a1) ...)

    Ran 1 test.
    0 tests passed.

    check-expect ... error ... :: first argument of equality cannot
    be a function, given (lambda (a1) ...)

    > my-add1
    my-add1
shhyou added a commit to shhyou/htdp that referenced this issue Nov 1, 2024
The pconvert-lib printer checks the namespace for (pre-)defined symbols.

If the current namespace is not configured, as what would happen during module
instantiation, user-written functions like my-add1 would be printed differently.
This also affects the error message from the check-expects.

    #lang htdp/isl+
    (define (my-add1 n) (+ n 1))
    my-add1
    (check-expect my-add1 2)

Output:

    Welcome to DrRacket.
    (lambda (a1) ...)

    Ran 1 test.
    0 tests passed.

    check-expect ... error ... :: first argument of equality cannot
    be a function, given (lambda (a1) ...)

    > my-add1
    my-add1
shhyou added a commit to shhyou/htdp that referenced this issue Nov 1, 2024
…racket#208.

The printer for ISL, ISL+ and ASL relies on use-named/undefined-handler
and named/undefined-handler to correctly print named lambdas.
In particular, use-named/undefined-handler checks whether the option
use-function-output-syntax is set.

If use-function-output-syntax is not enabled, then during module
instantiation, user-written functions like my-add1 would be printed differently.
This also affects the error message from the check-expects.

    #lang htdp/isl+
    (define (my-add1 n) (+ n 1))
    my-add1
    (check-expect my-add1 2)

Output:

    Welcome to DrRacket.
    (lambda (a1) ...)

    Ran 1 test.
    0 tests passed.

    check-expect ... error ... :: first argument of equality cannot
    be a function, given (lambda (a1) ...)

    > my-add1
    my-add1
shhyou added a commit to shhyou/htdp that referenced this issue Nov 1, 2024
…racket#208.

The printer for ISL, ISL+ and ASL relies on use-named/undefined-handler
and named/undefined-handler to correctly print named lambdas.
In particular, use-named/undefined-handler checks whether the option
use-function-output-syntax is set.

If use-function-output-syntax is not enabled, then during module
instantiation, user-written functions like my-add1 would be printed differently.
This also affects the error message from the check-expects.

    #lang htdp/isl+
    (define (my-add1 n) (+ n 1))
    my-add1
    (check-expect my-add1 2)

Output:

    Welcome to DrRacket.
    (lambda (a1) ...)

    Ran 1 test.
    0 tests passed.

    check-expect ... error ... :: first argument of equality cannot
    be a function, given (lambda (a1) ...)

    > my-add1
    my-add1
shhyou added a commit to shhyou/htdp that referenced this issue Nov 2, 2024
…racket#208.

The printer for ISL, ISL+ and ASL relies on use-named/undefined-handler
and named/undefined-handler to correctly print named lambdas.
In particular, use-named/undefined-handler checks whether the option
use-function-output-syntax is set.

If use-function-output-syntax is not enabled, then during module
instantiation, user-written functions like my-add1 would be printed differently.
This also affects the error message from the check-expects.

    #lang htdp/isl+
    (define (my-add1 n) (+ n 1))
    my-add1
    (check-expect my-add1 2)

Output:

    Welcome to DrRacket.
    (lambda (a1) ...)

    Ran 1 test.
    0 tests passed.

    check-expect ... error ... :: first argument of equality cannot
    be a function, given (lambda (a1) ...)

    > my-add1
    my-add1
shhyou added a commit to shhyou/htdp that referenced this issue Nov 4, 2024
…racket#208.

The printer for ISL, ISL+ and ASL relies on use-named/undefined-handler
and named/undefined-handler to correctly print named lambdas.
In particular, use-named/undefined-handler checks whether the option
use-function-output-syntax is set.

If use-function-output-syntax is not enabled, then during module
instantiation, user-written functions like my-add1 would be printed differently.
This also affects the error message from the check-expects.

    #lang htdp/isl+
    (define (my-add1 n) (+ n 1))
    my-add1
    (check-expect my-add1 2)

Output:

    Welcome to DrRacket.
    (lambda (a1) ...)

    Ran 1 test.
    0 tests passed.

    check-expect ... error ... :: first argument of equality cannot
    be a function, given (lambda (a1) ...)

    > my-add1
    my-add1
shhyou added a commit that referenced this issue Nov 11, 2024
…#208.

The printer for ISL, ISL+ and ASL relies on use-named/undefined-handler
and named/undefined-handler to correctly print named lambdas.
In particular, use-named/undefined-handler checks whether the option
use-function-output-syntax is set.

If use-function-output-syntax is not enabled, then during module
instantiation, user-written functions like my-add1 would be printed differently.
This also affects the error message from the check-expects.

    #lang htdp/isl+
    (define (my-add1 n) (+ n 1))
    my-add1
    (check-expect my-add1 2)

Output:

    Welcome to DrRacket.
    (lambda (a1) ...)

    Ran 1 test.
    0 tests passed.

    check-expect ... error ... :: first argument of equality cannot
    be a function, given (lambda (a1) ...)

    > my-add1
    my-add1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant