Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6836929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:24:54+00:00 2026-05-26T23:24:54+00:00

let a = [ 1; 2; 3; if 3 > 2 then 4; else

  • 0
let a = [
    1;
    2;
    3;
    if 3 > 2 then
        4;
    else
        5;
    6
]

Which fails with a “this construct is depracated … … Paranthesize this expression to indicate it is an individual element of the list…”, which I do,

let a = [
    1;
    2;
    3;
    (if 3 > 2 then
        4
    else
        5);
    6
]

causing the compiler to tell me “unmatched ‘(‘”. Obviously the compiler does not like the paranthesized multi-line conditional. Why is that? And is there any way around it?

This is a trivial case, but in the actual use I will have arbitrarily complex recursive expressions (hence needing to split it over multiple lines), and I do not want to break up the expression and do it imperitively via list-appending and what not.

EDIT:
this works :

let a = [
    1;
    2;
    3;
    if 3 > 2 then yield(
        4
    )else yield(
        5);
    6
]

but is somewhat more wordy than I would prefer (5 keywords and 4 parenthesis for a simple ternary operation!). The search for something cleaner continues

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:24:54+00:00Added an answer on May 26, 2026 at 11:24 pm

    You just need to indent the else as it is to the left of the if after you add the (

    let a = [
        1;
        2;
        3;
        (if 3 > 2 then
            4
         else //same column as matching if
            5);
    6
    ]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have this string var: string strData = 1|2|3|4||a|b|c|d Then, I make
Let's say I accidentally wrote this: do { } while (true); ...and then ran
I have a VARCHAR which value aaa or bbb let say depend on this
I'm making a grocery list application in which I'd like to let users check
I'm trying to send a broadcast and then let the server reply to it:
Let's say I have an array of zeros: a = numpy.zeros(1000) I then introduce
Let's say I have committed some bad changes to Subversion repository. Then I commit
Lots of frameworks let me expose an ejb as a webservice. But then 2
OpenGL. Let's say I've drawn one image and then the second one using XOR.
I'd like to just create a thread, then call CloseHandle immediately and let the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.