Alexander Burger <a...@software-lab.de> writes:

On Sat, Mar 13, 2021 at 06:48:22PM +0100, Tomas Hlavaty wrote:
   (de <div> (Col . Prg)
      (prin "<div class=\"" Col "\">")
      (run Prg)
      (prin "</div>") )

prin has side-effect.

Nonsense! 'prin' *is* the only and desired effect.

Mm, it seems to me that there might be a mutual misunderstanding here, due to two different meanings of 'side-effect'.

The lay meaning of 'side-effect' is "an effect in addition to the one that was intended/desired".

A technical meaning of 'side-effect', in functional programming, is "something which changes state":

   https://en.wikipedia.org/wiki/Side_effect_(computer_science)

In this context, printing something to an output device changes global state; the 'state of the world' has been changed to one that includes the content output.

My guess is that Tomas is using the latter meaning, and wants 'pure' functions that simply return strings, without sending them to an output device. The final string to be output would be created by combining the return values of multiple functions, possibly performing transformations on them along the way, then sending _that_ string to an output device. Is that correct, Tomas?


Alexis.

--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to