Hi Simon, this is similar to stuff in my own system command helper
script, I use it a lot:
https://bitbucket.org/hsarvell/ext/src/tip/cmd.l?at=default

It might give you some ideas.

On Thu, Apr 17, 2014 at 10:13 AM,  <> wrote:
> Hi, Simon,
>
> you can use "apply" here:
>
> (de exe2 (X)
>    (apply 'call X) )
>
> because "call" needs multiple arguments, but not one list.
>
> Best regards,
> Mansur Mamkin
>
> 17.04.2014 7:17, Simon Luetzelschwab пишет:
>
>> Hi,
>>
>> PicoLisp is my first LISP dialect and I'm trying to move some of the
>> things I do on the command line to PicoLisp's REPL and scripts.
>>
>> I'm playing around with pipes, in, out and call and have a basic question:
>>
>> If I have the following fun -
>>
>> (de exe (X)
>>     (eval (cons 'call X)) )
>>
>> I can call it as follows -
>>
>> (exe '("ls" "-l"))
>>
>> However, if I've defined it as -
>>
>> (de exe2 (X)
>>     (call X) )
>>
>> I can't figure out how to call exe2.
>>
>> (exe2 '("ls" "-l"))
>> ls-l: Can't exec
>> -> NIL
>>
>> I'm pretty sure I shouldn't be using eval for such a case, but can't
>> figure it out.
>>
>> Any insight much appreciated.
>>
>> Best,
>> Simon
>>
>> PS: I checked the reference, online docs and Henrik's Ext / cmd.l lib
>
> --
> UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe
--
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe

Reply via email to