generating numbers 1..N

From: vertigo (none_at_microsoft.com)
Date: 05/15/04


Date: Sat, 15 May 2004 10:57:45 +0200

Hello
i use SWI-Prolog version 5.2.8.
I wanted to receive list with numbers 1..N.
I tried:
findall(I,for(I,1,N),List)

but there is no 'for' in this prolog.
I tried to do it by hand:
create(N,Numbers):-
     create2(N,[],Numbers).
create2(N,IPath,OPath):-
     conc(N,IPath,OPath),
     Max is N-1,
     ((Max >0, create2(Max,IPath,OPath)) ; (Max=<0)).

conc([],[],[]).
conc([],L,L).
conc(L,[],L).
conc([X,L1],L2,[X,L3]):-
     conc(L1,L2,L3).

but i always receive:
?- create(4,X).

No

Why ?
How can i solve this problem ?

Thanx
Michal