Ask Your Question
0

How to evaluate two lines?

asked 2016-11-01 08:10:08 -0500

Chanof gravatar image

updated 2016-12-16 02:17:41 -0500

lennart gravatar image

Hi there, thanks for your support, I'm looking to "patterns guide" about how to evaluate two lines in the same time without result. Could you help me about? I've reading about to add a line break but i don't know what is

This is the case

d1 $ sound "superpwm s s s"
d2 $ sound "s s s supersquare"

cmd/enter don't work

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-11-01 10:22:00 -0500

bgold gravatar image

You can't directly send multiple commands to the interpreter at once, but there are a few different ways of chaining things together to do multiple things at the same time

If you just want to layer patterns on top of each other, you can use stack and have them go to the same "output"

d1 $ stack [ sound "superpwm s s s", sound "s s s supersquare"]

If you really want to have one thing go to d1 and the other to d2, you can "sequence" the two in a single command

(d1 $ sound "superpwm s s s") >> (d2 $ sound "s s s supersquare")

which in Haskell means exactly the same thing as

do { d1 $ sound "superpwm s s s" ; d2 $ sound "s s s supersquare" }

You can indent the last one in the way you'd expect

do { 
  d1 $ sound "superpwm s s s";
  d2 $ sound "s s s supersquare" 
}
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-11-01 08:10:08 -0500

Seen: 116 times

Last updated: Nov 01 '16