Re: multilines strings "a la python"
Algaba <[email protected]>
| Newsgroups | gmane.comp.gnu.prolog.general |
|---|---|
| Message-ID | <[email protected]> |
El 31/01/15 19:48, Ulrich Neumerkel escribió: > ((I am not sure that this will receive all recipients)) > > Jose F. Morales: >> Other Prolog systems support multiline strings also with "..." syntax. Does >> anyone remember if that is incompatible with ISO Prolog standard? If not, >> is there any reasonable syntax extension that can be adopted by other >> Prolog implementations too? >> >> (I've included Ulrich Neumerkel in the discussion) >> >> On Sat, Jan 31, 2015 at 12:35 PM, Algaba <[email protected]> wrote: >> >>> hello >>> >>> Desperately, I need multilines strings "a la python", something like : >>> >>> a_predicate(""" this is a multiline > This cannot be conforming Prolog syntax, that is, it cannot be a > syntax extension (5.5.1) as it interferes with valid Prolog syntax. > The minimal counterexample is probably: > > :- set_prolog_flag(double_quotes,atom). > > """+"b. /* > """*/ I haven't used such example in my life, and probably I won't . If triple double quotes is a problem, any other combination ( ''', !!!, {{{) would be fine as well. > > which corresponds to > > +('',b). > > With this extension, valid Prolog text would be interpreted > differently. > >>> Putting \n\ at the end of each line is a huge nuisance in copy/paste >>> operations > I add such text in Emacs with C-x r t \n\ Return > So spaces are added in lines that happen to be shorter. Yes, I do create a macro that adds \n\ to the end of the line and then I execute it n-times. But it's not nearly as easy as in python. greetings ... algaba _______________________________________________ Users-prolog mailing list [email protected] https://lists.gnu.org/mailman/listinfo/users-prolog