P5-interpolation

Jul 20, 2023

Implement arbitrary string interpolation semantics for Perl

Beginners always want to write this

print “The sum of three and four is 3+4”;

And they want the 3+4 part to be evaluated, so that it prints this

The sum of three and four is 7

Of course, it’s a double-quoted string, so it’s not evaluated. The only things that are evaluated in double-quoted strings are variable references.

There are solutions to this, but most of them are ugly. This module is less ugly.



Checkout these related ports:
  • Zig - Language designed for robustness, optimality, and maintainability
  • Zephir - Zephir is a transpiled language used for creating C-extensions for PHP
  • Ypsilon - Scheme implementation for real-time applications
  • Yorick - Interpreted language for scientific simulations
  • Yap - High-performance Prolog compiler
  • Yap-devel - High-performance Prolog compiler
  • Yabasic - Yet another Basic for Unix and Windows
  • Voc - Vishap Oberon Compiler for Oberon-2
  • Vala - Programming language and compiler that converts Vala code into C code
  • V8 - Open source JavaScript engine by Google
  • V8-beta - Open source JavaScript engine by Google
  • V - V Programming Language
  • Urweb - Ultimate host for embedded domain-specific languages
  • Ucc - C Compiler Which Implements the ANSI C89 Standard
  • Twelf - Meta-logical framework for deductive systems