string evaculat in (if ...)

Q&A's, tips, howto's

string evaculat in (if ...)

Postby lyl » Fri Dec 07, 2018 1:04 am

Here is my code:

Code: Select all
(setq file-name-extension ".csv")
(if file-name-extension file-name-extension "")


I think the "if" expression should return a string ".csv", but I get nil.
Why is file-name-extension in the true part of the "if" expression not evaculated?
lyl
 
Posts: 3
Joined: Sun Mar 25, 2018 5:00 am

Re: string evaculat in (if ...)

Postby TedWalther » Fri Dec 07, 2018 1:13 am

Your example works for me, using newlisp 10.7.4 on Ubuntu. what version of newlisp are you using?
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence. Nine months later, they left with a baby named newLISP. The women of the ivory towers wept and wailed. "Abomination!" they cried.
TedWalther
 
Posts: 602
Joined: Mon Feb 05, 2007 1:04 am
Location: Abbotsford, BC

Re: string evaculat in (if ...)

Postby lyl » Fri Dec 07, 2018 1:22 am

@TedWalther
I'm very sorry. Now it does work and get the result I want.
I don't know why? Maybe I make some mistake?
newLISP-10.7.1 I use in Win7.
And many thanks for your prompt response!!
lyl
 
Posts: 3
Joined: Sun Mar 25, 2018 5:00 am


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 3 guests

cron