My argument with Perplexity AI
I win, ๐
Perplexity AI kept insisting that BASIC-PLUS did not support multi-line function definitions. Here's its response when I gave it a direct reference. Even more perplexing (๐) are some of the references it gave. The last reference is to a writing guide from the Supreme Court of Ohio.
You are correct: the **1975 BASIC-PLUS Language Manual** does document multi-line user-defined functions using `DEF FN` and `FNEND`. Page 8-1 of the manual explicitly introduces the syntax for multi-line function definitions with `DEF FNname(arg,...)` followed by any number of statements, ending with a `FNEND` statement[1]. This allows users to write more complex functions than single-line DEF FNs.
To clarify with exact language from the referenced manual:
> "A function definition consists of the keyword DEF followed by the function name and a list of arguments in parentheses. The definition may consist of any number of statements. The definition ends with the statement FNEND."
This means **the original BASIC-PLUS for RSTS/E did in fact support multi-line DEF FN/FNEND blocks with local arguments**, as you remembered.
My previous response was incorrect to state that only single-line DEF FNs were supported in original BASIC-PLUS; while this is true for many other BASIC dialects, the DEC BASIC-PLUS for the PDP-11 introduced the powerful multi-line function feature, as documented in the official manual you cited[5][1].
Thank you for the correction and for providing a primary documentation reference.
---
[1] DEC-11-ORBPB-A-D_BASIC-PLUS_LangMan_Jul75.pdf, page 8-1[5].
Sources
[1] DEC-11-ORBPB-A-D_BASIC-PLUS_LangMan_Jul75.pdf https://bitsavers.org/pdf/dec/pdp11/rsts_e/V06/DEC-11-ORBPB-A-D_BASIC-PLUS_LangMan_Jul75.pdf
[2] [PDF] BASIC-PLUS-2 User's Guide https://neilrieck.net/misc/pdf/vms-docs/basic-plus-2-ug-27-580.pdf
[3] [PDF] PDP 11 Software Handbook https://ia802200.us.archive.org/15/items/PDP-11_Software_Handbook/PDP-11_Software_Handbook.pdf
[4] [PDF] RSTS PROFESSIONAL - Bitsavers.org http://bitsavers.org/magazines/RSTS_Professional/RSTS_Professional_V03_N01_198103.pdf
[5] [PDF] BASIC-PLUS Language Manual - Elvira http://elvira.stacken.kth.se/rstsdoc/rsts-doc-v92/v9.2-v5-a-basic-plus_language_manual.pdf
[6] [PDF] basic-plus - language manual - Bitsavers.org https://www.bitsavers.org/pdf/dec/pdp11/rsts_e/V06/DEC-11-ORBPB-A-D_BASIC-PLUS_LangMan_Jul75.pdf
[7] [PDF] BASIC-PLUS-2 Documentation Supplement http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/pdp11/pro3xx/POS/AA-P102B-TK_BASIC-PLUS-2_Documentation_Supplement_198305.pdf
[8] Procedure Manual | U.S. Department of Labor https://www.dol.gov/agencies/owcp/FECA/regs/compliance/DFECfolio/FECA-PT2/group3
[9] [PDF] RSTS/E - Your.Org http://ftpmirror.your.org/pub/misc/bitsavers/pdf/dec/pdp11/rsts_e/V06/DEC-11-ORDAA-A-D_DocDir_Jul75.pdf
[10] [PDF] Writing Manual Third Edition - Supreme Court of Ohio https://www.supremecourt.ohio.gov/docs/ROD/manual3e.pdf

