• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

2.15.1 ISO Syntax Support
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • Overview
        • The SWI-Prolog syntax
          • ISO Syntax Support
            • Processor Character Set
            • Nested comments
            • Character Escape Syntax
            • Syntax for non-decimal numbers
            • Using digit groups in large integers
            • Rational number syntax
            • NaN and Infinity floats and their syntax
            • Force only underscore to introduce a variable
            • Unicode Prolog source
            • Singleton variable checking
    • Packages

2.15.1.2 Nested comments

SWI-Prolog allows for nesting /* ... */ comments. Where the ISO standard accepts /* ... /* ... */ as a comment, SWI-Prolog will search for a terminating */. This is useful if some code with /* ... */ comment statements in it should be commented out. This modification also avoids unintended commenting in the example below, where the closing */ of the first comment has been forgotten.28Recent copies of GCC give a style warning if /* is encountered in a comment, which suggests that this problem has been recognised more widely.

/* comment

code

/* second comment */

code

ClioPatria (version V3.1.1-51-ga0b30a5)