Splitting a list before and after a particular element in prolog (without using “split” predicate?)
问题 I'm trying to split a list into the items before a specific element (specifically the word "stop") as well as the items after this element. I know you can use split to do this, but I'm new to prolog and so I'm trying to manipulate things without using these functions currently, and so I'd really like to know if this is possible? (and maybe some pointers in the right direction) i.e. with the list; L = [tea,coffee,sugar,cake,stop,meat,fish,eggs,flour] I'd ideally want to split the list at 'stop