Search found 607 matches

by rickyboy
Fri Feb 20, 2015 10:34 pm
Forum: newLISP and the O.S.
Topic: Windows 8.1 short file names fail on import
Replies: 12
Views: 10893

Re: Windows 8.1 short file names fail on import

Thanks for the clarification, Neil, and all your sleuthing. That would have flummoxed me a bit too -- good report.
by rickyboy
Fri Feb 20, 2015 6:36 pm
Forum: newLISP and the O.S.
Topic: Windows 8.1 short file names fail on import
Replies: 12
Views: 10893

Re: Windows 8.1 short file names fail on import

Lutz wrote:I would watch the input parameters and error result of the import function
Exactly. When Neil said "the code that is failing" and "code ... to produce the error", I was thinking to myself, "Well, what *is* the error (message)?" :)
by rickyboy
Tue Feb 17, 2015 8:24 pm
Forum: newLISP in the real world
Topic: Scheme "letrec" equivalent
Replies: 4
Views: 3276

Re: Scheme "letrec" equivalent

Yeah, np. BTW, regular ol' let works for this example too. (let ((local-even? (lambda (n) (if (= n 0) true (local-odd? (- n 1))))) (local-odd? (lambda (n) (if (= n 0) nil (local-even? (- n 1)))))) (list (local-even? 23) (local-odd? 23))) ;=> (nil true) If you're porting code from Scheme to newLISP, ...
by rickyboy
Tue Feb 17, 2015 7:18 pm
Forum: newLISP in the real world
Topic: Scheme "letrec" equivalent
Replies: 4
Views: 3276

Re: Scheme "letrec" equivalent

AFAIK, letrec is not needed in newLISP. Take Sitaram's classic example from http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme-Z-H-8.html#node_sec_6.1. You would simply use newLISP's letn to do that. (letn ((local-even? (lambda (n) (if (= n 0) true (local-odd? (- n 1))))) (local-odd? (lambda (n...
by rickyboy
Sat Jan 24, 2015 3:57 am
Forum: newLISP in the real world
Topic: bug of newLISP v.10.6.0
Replies: 6
Views: 4133

Re: bug of newLISP v.10.6.0

:)

The TLDR is that newlisp parses 2323abc as two atoms, namely the integer 2323 and the symbol abc. Finally, the primitive number? only reads its first argument (and ignores any additional arguments). So saying

Code: Select all

(symbol? 2323abc)
is the same as saying

Code: Select all

(symbol? 2323 abc)
by rickyboy
Sat Jan 24, 2015 3:47 am
Forum: newLISP in the real world
Topic: bug of newLISP v.10.6.0
Replies: 6
Views: 4133

Re: bug of newLISP v.10.6.0

It's not a bug. 2323 is a number.
by rickyboy
Tue Jan 20, 2015 1:45 am
Forum: newLISP newS
Topic: newLISP stable release 10.6.2
Replies: 20
Views: 21388

Re: newLISP stable release 10.6.2

Thanks, Lutz!

BTW, when you make a release like this, do you ping the port maintainers of newlisp on the BSDs, or do they have to keep up with the releases by keeping their own eye out for them? Just curious. I've always meant to ask you this.
by rickyboy
Mon Jan 12, 2015 4:30 am
Forum: newLISP in the real world
Topic: Weird behavior for function `symbol?`
Replies: 2
Views: 2521

Re: Weird behavior for function `symbol?`

Thank you, Lutz!
by rickyboy
Sun Jan 11, 2015 2:51 am
Forum: newLISP in the real world
Topic: Weird behavior for function `symbol?`
Replies: 2
Views: 2521

Weird behavior for function `symbol?`

Running 10.6.0 on FreeBSD.

Check this:

Code: Select all

> (context 'Another)
Another
Another> (symbol? 'x)
true
Another> (symbol? 'Try:x)

ERR: context expected in function symbol? : Another:Try
But the same calls work in MAIN.

Code: Select all

> (symbol? 'x)
true
> (symbol? 'Try:x)
true
Why?
by rickyboy
Wed Jan 07, 2015 5:48 pm
Forum: Anything else we might add?
Topic: *(quote fn) or (quote lambda)* error
Replies: 2
Views: 5327

Re: *(quote fn) or (quote lambda)* error

Lutz explained why this so, not too long ago here: http://www.newlispfanclub.alh.net/forum/viewtopic.php?f=5&t=4553&p=22482#p22482 In short, fn and lambda cannot be symbols in the sense you are using them. If you are trying to build newLISP lambdas in your macro code, then follow Lutz's advice in th...
by rickyboy
Wed Jan 07, 2015 3:58 am
Forum: Anything else we might add?
Topic: un-declared symbol name would set to nil
Replies: 2
Views: 5041

Re: un-declared symbol name would set to nil

Yeah, that behavior is baked into newLISP. I have also experienced this problem before also -- where I've misspelled a symbol name and newLISP happily evaluates it to nil. However, I've always been able to detect this error in unit testing; so it hasn't been a problem for me. How to help check for t...
by rickyboy
Wed Jan 07, 2015 3:42 am
Forum: Anything else we might add?
Topic: lexical declare function
Replies: 2
Views: 5262

Re: lexical declare function

In newLISP, lexical symbol is declare with *let*, *letn*, *letex* and *args expression*. No. You are misusing the term "lexical". In Perl parlance, it means "static(ally) scope(d)." This also means "lexically scoped." Now, the problem is that you are comparing apples to oranges, as newLISP "variabl...
by rickyboy
Mon Jan 05, 2015 4:31 pm
Forum: newLISP in the real world
Topic: Problem with (json-parse) false/nil
Replies: 5
Views: 4551

Re: Problem with (json-parse) false/nil

Also I see Kanen's point about what is said in the manual about it. From http://www.newlisp.org/downloads/newlisp_manual.html#json-parse: All data types conforming to the ECMA-262 standard are translated. In turn, the ECMA-262 standard here says There are only two Boolean values, true and false. The...
by rickyboy
Mon Jan 05, 2015 4:18 pm
Forum: newLISP in the real world
Topic: Problem with (json-parse) false/nil
Replies: 5
Views: 4551

Re: Problem with (json-parse) false/nil

You need to reserve nil for newLISP when lookup fails I thought that's what exp-default was for. From http://www.newlisp.org/downloads/newlisp_manual.html#lookup: syntax: (lookup exp-key list-assoc [int-index [exp-default]]) ... Optionally, exp-default can be specified, which is returned if an asso...
by rickyboy
Wed Dec 10, 2014 5:54 am
Forum: newLISP in the real world
Topic: Can I create a DAG in newlisp
Replies: 4
Views: 4336

Re: Can I create a DAG in newlisp

Here's another attachment of code. This contains the code from the previous post with a few additions. Everything you can do with parents and ancestors ("deep parents") in the former code, you can now do with children and descendants ("deep children") also. I also added some comments showing example...
by rickyboy
Wed Dec 10, 2014 5:30 am
Forum: newLISP in the real world
Topic: Can I create a DAG in newlisp
Replies: 4
Views: 4336

Re: Can I create a DAG in newlisp

I'd use FOOP. After all, FOOP "objects" are just lists (and using only lists was one of your requirements). Anyway, it seems like a natural choice. So, here's a walk through a FOOP implementation. First some preliminaries. (BTW, I always seem to use mappend , and this time was no different.) (define...
by rickyboy
Mon Nov 03, 2014 6:55 pm
Forum: So, what can you actually DO with newLISP?
Topic: How to call function each other with declaration
Replies: 3
Views: 5805

Re: How to call function each other with declaration

If I design a function, need call other function which also call this function. How to Decalare it: . . . What you wrote (or what ryuo wrote) is the basic idea. It is OK because the calls of sub-1 and sub-2 in the bodies of the functions (lambdas) only get resolved during call time. For instance, t...
by rickyboy
Fri Oct 03, 2014 4:29 am
Forum: newLISP in the real world
Topic: bug? about float point number lexical analysis
Replies: 9
Views: 7109

Re: bug? about float point number lexical analysis

psilwen, Are you suggesting that newLISP allow the user to enter a number of arbitrary length (as input) and then parse and store the internal representation of the number (as an exact representation of the input, i.e. arbitrarily large)? AFAIK, no programming language allows this. There are always ...
by rickyboy
Fri Oct 03, 2014 3:34 am
Forum: newLISP newS
Topic: newlisp 10.6.2 build on FreeBSD 10.0
Replies: 0
Views: 7942

newlisp 10.6.2 build on FreeBSD 10.0

Just a quick note FYI. For another topic in the fanclub, I needed to build 10.6.2. I was on one of my FreeBSD machines, so I did the build there. Bottom line is that it builds without an issue. There was only one change I had to make for the build. This: $ make should now be this: $ make CC=clang be...
by rickyboy
Fri Oct 03, 2014 3:24 am
Forum: newLISP in the real world
Topic: bug? about float point number lexical analysis
Replies: 9
Views: 7109

Re: bug? about float point number lexical analysis

Hello psilwen, Most of these issues you raise are not issues at all in version 10.6.2. I recommend you download and build that version on your machine and repeat these examples. I've done just that and I only recall this one example still being an issue. >$ ./newlisp newLISP v.10.6.2 64-bit on BSD I...
by rickyboy
Wed Oct 01, 2014 6:42 pm
Forum: newLISP in the real world
Topic: bug? about float point number lexical analysis
Replies: 9
Views: 7109

Re: bug? about float point number lexical analysis

Thank you, psilwen and Lutz!
by rickyboy
Tue Sep 16, 2014 7:09 pm
Forum: newLISP newS
Topic: newLISP Development Release v.10.6.1
Replies: 1
Views: 7575

Re: newLISP Development Release v.10.6.1

Thanks, Lutz!
by rickyboy
Sun Sep 07, 2014 10:57 pm
Forum: newLISP in the real world
Topic: Syllables
Replies: 5
Views: 5656

Re: Syllables

Looks like that could be made into a nice lookup table. It's easy to see the pronounced vowel sounds (in the code) and count them. That count should equal the syllable count. Nice find, Ralph!
by rickyboy
Sun Sep 07, 2014 8:54 pm
Forum: newLISP in the real world
Topic: Syllables
Replies: 5
Views: 5656

Re: Syllables

Kanen, To answer your question, no. But, assuming you mean English words and you want a purely algorithmic approach, it looks like the best you can do it is by heuristic. The first (highest voted answer) on this stackoverflow post has a link to the TeX hyphenation algorithm. That looks pretty promis...
by rickyboy
Sun Aug 17, 2014 10:09 pm
Forum: newLISP in the real world
Topic: how to expand list-map
Replies: 2
Views: 2913

Re: how to expand list-map

Just use (args) . (Other lisps call them rest args.) > (define (my-silly-func) (cons 'op (args))) (lambda () (cons 'op (args))) > (map my-silly-func '(1 2 3)) ((op 1) (op 2) (op 3)) > (map my-silly-func '(1 2 3) '(4 5 6)) ((op 1 4) (op 2 5) (op 3 6)) > (map my-silly-func '(1 2 3) '(4 5 6) '(7 8 9)) ...