Sorry for a beginner question. I cannot find a forum where I can ask very beginner-type syntax questions. I will ask it here for now. I used the recommended textbooks, by Evan, by Pawan Poudel, but I puzzle over them for days, stuck, since October.
My question today is, based on what I have learned, the below code I wrote should not run, but it does!
“foobar” can be anything. But the code breaks if I remove it. It seems both meaningless and vital. What role is “foobar” playing?
What do the first two words of my program below mean, what are they called, are they strings? variables? function and argument? the two-word syntax of ‘view model’ tells me there is a function called VIEW that takes one argument, MODEL. But that is wrong. Stuck.
` view model =
[ article  [ text “Yayyyy” ]
, button  
Sorry, I know this is not the right place for this question.
no need to apologize, you’re asking in the right place! I can also recommend #beginners on Slack (which it seems like you’ve already found.)
You’ve actually mostly got it already: you have function called view that takes an argument called model. That function, right now, is taking "foobar" but ignoring it as it’s not used anywhere in the body of the function. If you want to remove "foobar" you’ll need to not take the argument.
[ article  [ text "Yayyyy" ]
, button  
and you would call it like this:
Just to reinforce: welcome to the Elm community! I hope you enjoy yourself here! Please feel free to ask questions wherever you feel comfortable.