Strict Programming Language

Strict Programming Language

  • Docs
  • API
  • Blog

›All Blog Posts

All Blog Posts

  • March 2023 Mutable
  • January 2023 Multi Line Text Expressions and Introducing New Lines in Strict
  • January 2023 Namings in Strict
  • December 2022 Traits and Components
  • November 2022 Multi Line List Expressions
  • November 2022 Strict Base and Example folders moved to separate repository
  • October 2022 Shunting Yard
  • September 2022 For loops
  • September 2022 Details about Mutability in Strict
  • July 2022 Introduction To Generics In Strict
  • May 2021 Strict Newbie Experiences
  • June 2021 Slow Progress
  • May 2021 BNF Grammar
  • May 2021 Next Steps
  • Jul 2020 Getting Back Into It
  • Jul 2020 Optimizing FindType
  • Jul 2020 Package Loading
  • Jun 2020 Parsing Methods
  • Jun 2020 As Simple As Possible
  • Jun 2020 Back to blogging
  • May 2020 Slow and not steady
  • Apr 2020 Sdk going open source
  • Feb 2020 Still work in progress
  • Jan 2020 website is up

November 2022 Multi Line List Expressions

November 9, 2022

Murali Tandabany

In strict, majority of the expressions will contain less characters and the length of each line can be contained within 120 character which is the hard limit for any line in strict. One exception is the list type containing more number of elements and in few cases the line length can extend beyond 120 limit. Below is one example program where the list expressions line length goes beyond the maximum limit.

has numbers,
has anotherNumbers Numbers,
GetMixedNumbers Numbers
    (numbers(0), numbers(1), numbers(2), numbers(3), numbers(4), numbers(5), numbers(6), anotherNumbers(0), anotherNumbers(1), anotherNumbers(2))

Multi Line List Expressions

In order to resolve this issue, we have introduced a new feature in Strict to support multi line List expressions. If any list expression which has length above 100 characters, then it is allowed to use multiple lines for the list elements with each list element in a separate line ending with comma. These lines should follow the same indentation as beginning line of the list expression.

The above program should be written as shown below using multi line list expressions.

has numbers,
has anotherNumbers Numbers,
GetMixedNumbers Numbers
    (numbers(0),
    numbers(1)
    numbers(2)
    numbers(3)
    numbers(4)
    numbers(5)
    numbers(6)
    anotherNumbers(0)
    anotherNumbers(1)
    anotherNumbers(2))

Usage Not Allowed

If the total length of the list expression is below 100, then it is not allowed to use multi lines to write those list expressions and should be always written in a single line.

For example below program is not allowed in strict as the total length of the list expression is below 100 characters.

has log
Run
    log.Write((1,
    2,
    3,
    4,
    5,
    6,
    7))

For more information, please refer to the strict example programs in the GitHub repositories.

Recent Posts
  • Multi Line List Expressions
  • Usage Not Allowed
Strict Programming Language
Docs
Getting StartedCoding StyleAPI Reference
Community
Stack OverflowProject ChatTwitter
More
HelpGitHubStar
Copyright © 2023 strict-lang