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

Specify semantics of #ifTrue:/#ifFalse: and allow/disallow Smalltalk 80 style optimizations #100

Open
smarr opened this issue May 4, 2022 · 0 comments
Labels
language design This issue requires design decisions spec Needs specification, or is specification related.

Comments

@smarr
Copy link
Member

smarr commented May 4, 2022

Often Smalltalk implementations would special-case control structures to simplify implementations.

Personally, I think this isn't great. Though, I haven't bothered implementing it correctly either.

It would be good to specify the semantics, or, at the very least, explicitly have an example, and tests to ensure that #ifTrue: and similar are treated as pure messages, and any implementation optimization is not observable from the language itself.

See smarr/SOMpp#7 for further discussion.

@ltratt's example should work. I don't think there's any good justification for it not to work.

T = (
    ifTrue: x = ( ^2 )

    run = (
        (self ifTrue: 3) println.
    )
)
@smarr smarr added spec Needs specification, or is specification related. language design This issue requires design decisions labels May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language design This issue requires design decisions spec Needs specification, or is specification related.
Projects
None yet
Development

No branches or pull requests

1 participant