You know better than that. Flip flops are memory and they are not a latch (in the context of what a designer would describe and use, not what a flip flop is at the transistor level).
Should be read "A memory in combinational always block". I guess.
There are some applications where you intentionally infer a latch, e.g. in some cases, a transparent latch is better suited as address register in a multiplexed processor bus than a flip-flop.
always@(sample,inp)begin// combinational code as FvM mentionedif(sample==0)begin
vinp=vinp;// memory as Tricky mentionsendelsebegin
vinp=inp;endend
Without a posedge or negedge sensitivity on a signal the always block will always infer either combinational logic or a latch (if any outputs are fed back or not defined in a branch).
Yes the OP posted code for a latch, but the question the OP posted is can you not infer a latch for a sample and hold. The answer there is yes, use a flip flop.