Groups | Search | Server Info | Login | Register


Groups > comp.lang.smalltalk > #856

Executing Smalltalk Scripts In Jupyter

From Lawrence D'Oliveiro <ldo@nz.invalid>
Newsgroups comp.lang.smalltalk
Subject Executing Smalltalk Scripts In Jupyter
Date 2024-03-18 22:36 +0000
Organization A noiseless patient Spider
Message-ID <utaflc$dev9$3@dont-email.me> (permalink)

Show all headers | View raw


Jupyter notebooks don’t have to have all their code written in one 
language; you can use the “%%script” cell magic to intersperse cells 
containing code in quite a different language.

For example, with GNU Smalltalk installed, I could (following an example 
in the User Guide) type the following in a notebook cell:

    %%script gst
    x := Set new.
    x add: 5; add: 7; add: 'foo'.
    x printNl.

and get the output

    Set (7 5 'foo' )

What’s nice is that I don’t have to specify any options to turn off 
extraneous startup/prompt messages. On the downside, I haven’t yet found 
an option for automatic display of any value returned from the last line. 
E.g. it would be nice if a sequence like

    %%script gst
    2 + 2

would produce the output “4”. I can get such a thing with some other 
language implementations, but not this one.

Back to comp.lang.smalltalk | Previous | Next | Find similar


Thread

Executing Smalltalk Scripts In Jupyter Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-03-18 22:36 +0000

csiph-web