##LOGO, 33 bytes##
LOGO, 33 bytes
[cascade ?2 "bf cascade ?3 "bl ?]
Try it on FMSLogo.
This is a template-list in LOGO, which is the equivalent of lambda (anonymous) function in many other languages.
Where:
cascadeoutputs the result of applying a template repeatedly, in this case is?2timesbfand?3timesbl.bfandblstands forButFirstandButLastrespectively.?is used to access parameters. So?2is the second parameter,?3is the third parameter, etc.
Test:
show apply [cascade ?2 "bf cascade ?3 "bl ?] [[1 2 3 4 5 6] 2 1]
print [3 4 5].