Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - newdep

#1
newLISP newS / Error in 10.7.6
December 28, 2021, 08:48:51 AM
There is an error in 10.7.6 .. returns a lot of questions ;-)

Question is, is the question mark a legal type? of a missing type?

(or im i pushing into the blue here..;-)

newLISP v.10.7.6 64-bit on Linux IPv4/6 UTF-8 libffi, options: newlisp -h

Do it like this, else it wont error (double push) ->

> x

nil

>(push x x)

(?)

>(push x x)

any more text below and the forum returns an error... see the replys below
#2
newLISP in the real world / after coffee
December 24, 2021, 02:46:34 PM
..just to keep the brain awake...

http://newlisp.digidep.net/magic.lsp">//http://newlisp.digidep.net/magic.lsp



;
; Magic (odd, not even) square solver by nodep.
;
;     0   1   2  
;   ------------+
; 0 | a | c | b |
;   |-----------|  
; 1 | d | e | f |
;   |-----------|
; 2 | g | h | i |
;   +-----------+    
;
; The trick..
;          ..is very simple
;

 ;;-- 1..9
 ;;(setq numbers (sequence 1 9))

 ;;-- 4096..5104
 (setq numbers (sequence 4096 5104))
 
 ;;-- determine the middle
 (setq middle (numbers 4))

 ;;-- calculate the sum
 (setq sum (add (numbers 0) (numbers -1) middle))

 ;;-- listy 3x3 square
 (setq s '( () () () ))

 ;;-- solve
 (push middle (s 1))
 (push (numbers  0) (s 0))
 (push (numbers -1) (s 2))
 (push (numbers  1) (s 2) -1)
 (push (numbers -2) (s 0))    
 (push (numbers  2) (s 1))
 (push (numbers -3) (s 1) -1)
 (push (numbers  3) (s 2))
 (push (numbers -4) (s 0) -1)
 
 ;;-- display
 (println "The Magic = " sum)
 (map println (map string s))
 
 ;;-- Enjoy.. ;-)
 
 (exit)
 
#3
newLISP in the real world / befor the coffee
December 24, 2021, 04:35:34 AM
...brain gymnastics instead of coffee...



http://newlisp.digidep.net/triarray.lsp">//%20http://newlisp.digidep.net/triarray.lsp



(load "http://newlisp.digidep.net/triarray.lsp")
#4
newLISP in the real world / Another code tree
December 23, 2021, 07:04:03 AM
Small tree test
#5
[size=200]HAPPY 2013[/size]





To all newlispers... A good and frutefull newlisp year.. may the source be with you this year!



Lutz thanks for the releases this year.. hope to see more ;-)



Greetings, Norman
#6
Hi Lutz,



Has been a while but i picked up the OS/2 release again for newlisp. My system is running natively again.



Since 10.1.5 some changes where made and compiling is oke upto nl-sock.c



ipv6 has been introduced and OS/2 / eComstation is one of those OS's at the moment that has no support for it. This mean no header files for ipv6 at all.



I tried some plugin header files , from the lwres, that where build for systems that dont have ipv6 support but in the end im running into a linking error. Simply the gcc library isnt up for it right now.



I spitted thru the nl-sock.c history and i cant even use the older versions as these have changed the last 2 years.

I would like to stick with the 10.4.5 version of the nl-sock.c but i must exclude a lot to get it compiled without

ipv6.



Is there a quick and or simple way to fully disable ipv6 from the compilation? Or do you have a trick that

would save me bunches of #infdef OS2 | #ifndef IPV6 inside the nl-sock.c file  ?



Hope you have an idea for a 32bits compilation that fits the ipv4 only system structure ..like OS/2...
#7
newLISP newS / newlisp.org unreachable
November 13, 2012, 10:55:20 AM
just for the notification to the forum members a.o.



newlisp.org is currently unreachable 19:45 CET 13-Nov-2012...



Course is unknown to me but could be a nfs host issue... waiting for confirmation...
#8
Again a syntax highlight for newlisp, but this time for a very good text editor!

Im working on a snippets collection too..its on its way...  ;-)



Enjoy..





; EmEditor Syntax File
;
; To import this file to an existing configuration, select Configuration
; under the Tool menu, select Define Configurations, select a configuration
; you want to import to, press [Properties], select the Highlight page, and
; press [Import].
;
; emeditor newLisp highlights v 1.0 by newdep 2012 (http://www.newlisp.org)
;
; Submit your customized file to submit@emurasoft.com
; to be listed in www.emurasoft.com user files pages.
;
#Highlight=on
#BeginTag=
#EndTag=
#CommentBegin=[cmd]
#CommentEnd=[/cmd]
#LineComment1=^;
#LineComment2=^#
#SingleQuote=off
#DoubleQuote=on
#ContinueQuote=off
#Escape=
#ScriptBegin=
#ScriptEnd=
#SpecialSyntax=off
#HighlightBraces=on

#Keyword color=2,word=on,rightall=off,case=off,insidetag=off,regexp=off,rightall2=off
$
$0
$1
$10
$11
$12
$13
$14
$15
$2
$3
$4
$5
$6
$7
$8
$9
$args
$idx
$it
$main-args

#Keyword color=3,word=on,rightall=off,case=off,insidetag=off,regexp=off,rightall2=off
!
!=
%
&
*
+
-
/
:
<
<<
<=
=
>
>=
>>
?
@
|
~

#Keyword color=1,word=on,rightall=off,case=off,insidetag=off,regexp=off,rightall2=off
Class
MAIN
NaN?
Tree
abort
zero?
abs
acos
acosh
add
address
amb
and
append
append-file
apply
args
array
array-list
array?
asin
asinh
assoc
atan
atan2
atanh
atom?
base64-dec
base64-enc
bayes-query
bayes-train
begin
beta
betai
bind
binomial
bits
callback
case
catch
ceil
change-dir
char
chop
clean
close
command-event
cond
cons
constant
context
context?
copy
copy-file
cos
cosh
count
cpymem
crc32
crit-chi2
crit-z
current-line
curry
date
date-value
debug
dec
def-new
default
define
define-macro
delete
delete-file
delete-url
destroy
det
device
difference
directory
directory?
div
do-until
do-while
doargs
dolist
dostring
dotimes
dotree
dump
dup
empty?
encrypt
ends-with
env
erf
error-event
error-number
error-text
estack
eval
eval-string
exec
exists
exit
exp
expand
explode
factor
fft
file-info
file?
filter
find
find-all
first
flat
float
float?
floor
flt
for
for-all
format
fv
gammai
gammaln
gcd
get-char
get-float
get-int
get-long
get-string
get-url
global
global?
if
if-not
ifft
import
inc
index
int
integer
integer?
intersect
invert
irr
join
lambda?
last
legal?
length
let
letex
letn
list
list?
load
local
log
lookup
lower-case
macro?
main-args
make-dir
map
mat
match
max
mdl
member
min
mod
module
mul
multiply
name
net-accept
net-close
net-connect
net-error
net-eval
net-interface
net-listen
net-local
net-lookup
net-peek
net-peer
net-receive
net-receive-from
net-receive-udp
net-select
net-send
net-send-to
net-send-udp
net-service
net-sessions
new
nil
nil?
normal
not
now
nper
npv
nth
null?
number?
open
or
ostype
pack
parse
pipe
pmt
pop
pop-assoc
post-url
pow
pretty-print
primitive?
print
println
prob-chi2
prob-z
process
prompt-event
protected?
push
put-url
pv
quote
quote?
rand
random
randomize
read-buffer
read-char
read-expr
read-file
read-key
read-line
real-path
ref
ref-all
regex
regex-comp
remove-dir
rename-file
replace
reset
rest
reverse
rotate
round
save
search
seed
seek
select
semaphore
sequence
series
set
set-locale
set-ref
set-ref-all
setf
setq
sgn
share
signal
silent
sin
sinh
sleep
slice
sort
source
spawn
sqrt
starts-with
string
string?
sub
swap
sym
symbol?
symbols
sync
sys-error
sys-info
tan
tanh
throw
throw-error
time
time-of-day
timer
title-case
trace
trace-highlight
transpose
trim
true
true?
unify
unique
unless
unpack
until
upper-case
uuid
when
while
write-buffer
write-char
write-file
write-line
xml-error
xml-parse
xml-type-tags

#Keyword color=4,word=on,rightall=off,case=off,insidetag=off,regexp=on,rightall2=off
'

#Keyword color=5,word=on,rightall=on,case=off,insidetag=off,regexp=off,rightall2=on
[text]
[/text]
#9
Whither newLISP? / destructive setq ?
May 21, 2012, 03:13:40 PM
Hi Lutz,



The problem below looks familiar to me but i cant find/recall the explenation in the manual,

perhpas you can clear me up.. I would intepret it as a bug , as its not explained as a feature in the manual.



The question is , why doesn't the use of -1 or 'last apply to setq/setf for strings?

As the impression is made inside the manual that setq/setf can be used for string manipulation.



Problem is, with common sense, im unable to append 2 strings without deleting the last char. of the first.


> (setq A "Hello/")
"Hello/"
> (setq (A -1) "world")
"world"
> A
"Helloworld"
> (setq (A -1) "!")
"!"
> A
"Helloworl!"
> (setq (last A) "!")
"!"
> A
"Helloworl!"
>
#10
Hi Lutz,



is it possible to extend newlisp so that its capable of beeing a 'filter'.

So it accepts input during startup.



example:



echo "(println "hello newlisp")" | newlisp -e '(eval $main-args)'



I know $main-args wont work here but its just an example.



I would like to use newlisp in the command stream of linux this way.



Hope its something you to concider?



Greetings :-)
#11
Whither newLISP? / Feature request: parse
May 06, 2012, 08:36:36 AM
Hi Lutz,



A pothole for many (at least for me over and over again) is 'parse. ..i lost count..



Quicky parsing a string in newlisp cant be done without regex, or without inteferance of a pre-eval.

( And I believe a language should stay nice to look at ;-)



The pre-eval of str-data is something you quickly forget. The awkward part in parse is this

i.e. the octal issue, its already too late when its discovered...everyone runs into it at one time...



It would make a great improvement to useability versus expectation to see 'parse having an

extra parameter like: 'nil which indicated 'parse to handle its string being "dumb" without a pre-eval

of the str-data itself.



syntax: (parse str-data [str-break [int-option]] 'nil)



I believe it simply has many advantages having 'parse for quick & dirty use for str-data and

pass regex-crypto for simple things...



Hope its something you can consider? ;-)



Grt, Norman
#12
To all newlisp users and forum member and especialy to Lutz ;-)



[size=150]Merry Christmas and all the best for 2012![/size]
#13
newLISP in the real world / Loop without Loops
April 20, 2011, 11:29:22 AM
I was wondering how many functions inside newlisp are useable to a create a functional loop with.

So.. thats without the use of 'until 'while 'for (the existing repeat/loop functions)..etc..



Here a very basic example

functions themselfs can loop i.e. running either of these will return the looped function of (print y).

 

(define (loop x) (or (zero? x) (go x)) )
(define (go y) (print y) (loop (dec y)))

(go 10)
or
(loop 10)


Now im wondering what's more to use? I would love to see a 'map or 'apply functional loop without

the use of the pre-defined loop/repeat functions in it.

...did not figure it out yet ;-) Anyone ?
#14
newLISP and the O.S. / [BUG?] timer Unix vs Window
April 20, 2011, 12:08:31 AM
Hi Lutz,



Probably not a bug but a fault-catch issue and i'm not sure if it is supposed to crash under windows.



This doesn't crash under linux. Under windows it crashes newlisp.

(I know its not how the function is supposed to be handled..but just for the notification.. ;-)





newLISP v.10.3.0 on Linux IPv4/6, execute 'newlisp -h' for more info.



> (timer 'true 1)

0

>

ERR: invalid function : (true)

>
#15
I think this is a bug Lutz...


Quote
newLISP v.10.3.0 on Linux IPv4/6, execute 'newlisp -h' for more info.



> (symbol? a)

nil

> (symbol? b)

nil

> (symbol? 1)

nil

> (symbol? '1)

nil

> (++)

1

> (symbol? a)

1

> (symbol? b)

1

> (symbol? 1)

1

> (symbol? '1)

1

>


ps: goes for (--) as well...
#16
newLISP and the O.S. / IMAP checker via SSL
March 28, 2011, 03:20:07 PM
I dont know but perhpas handy to have for those who are in need of it.

A simple unseen IMAP SSL checkup. Im using it in an automated cycle that

pops up a message to the screen every 5 minutes.. you can rebuild it to you own taste.

Not all error checking is included but works for me..

Enjoy.. and ..btw it doesn't work with gmail.


Quote


#!/usr/bin/newlisp
;
; ---------------------------------------------------
; RAW IMAP unseen messages checkup over ssl
; assumes openssl installed!
; runs only on Unix/Linux.
; use at own risk.
; copyleft version 0.3, newdep.
; ---------------------------------------------------
;

(setq imaps-server "imap.server.dom")       ; imap secure server name
(setq imaps-port   "993")               ; ssl secure port (993)
(setq unseen 0)                         ; unseen messages
;(setq user "ScoobyDoo")                ; pre-set username
(setq dont-check '( "Trash" ))          ; dont check these boxes for new mail. must match exactly


;; predefined functions
(define (clear-and-wait)
        (setq buffer "")
        (sleep 2000))           ; 2 seconds wait, give the server some slack.

(define (grab-while-peek)
        (clear-and-wait)
        (while (!= 0 (peek cltin)) (setq buffer (read-line cltin))))

(define (ask-user)
        (setq user "")
        (print "nIMAPS username: ")
        (setq user (read-line)))

(define (ask-pass)
        (setq pass "" c "")
        (print "IMAPS password: ")
        (while (!= (format "%c" (setq c (read-key))) "n")
        (push (format "%c" c) pass -1) (print "*"))
        (verify-input))

(define (ask)
        (ask-user)
        (ask-pass))

(define (verify-input)
        (print "nAre these oke? (y/n/Q)")
                (case (lower-case (char (read-key)))
                ("n" (ask)) ("y" true) ("q" (exit)) ("n" (verify-input))))


;; if already defined user then only ask password
(if user (ask-pass) (ask))
(println "n* Connecting to ssl://" imaps-server ":" imaps-port)


;; create pipes to communicate with openssl
(map set '(cltin imapsout) (pipe))
(map set '(imapsin cltout) (pipe))
;; process to the background, must exist!
(setq imaps (process (append (first (exec "which openssl")) { s_client -connect } imaps-server {:} imaps-port) imapsin imapsout))
(if-not imaps
        (begin
                (println "* Unable to process openssl!")
                (destroy imaps)
                (exit)))

;; wait for response on previous action
(grab-while-peek)
;; is it oke?
(if (find "* OK " buffer)
        (begin
                (println "* SSL connection setup")
                (write-line cltout (append {. LOGIN} { } user { "} pass {"})))

        (begin
                (println "* No IMAP SSL server!")
                (destroy imaps)
                (exit)))

;; wait for response on previous action
(grab-while-peek)
;; is it ok?
(if (find " OK Logged "  buffer)
        (begin
                (println "* Logged in.")
                (write-line cltout {. LIST "" "*" }))
        (begin
                (println "* Wrong authentication")
                (destroy imaps)
                (exit)))


;; wait for response on previous action        
(clear-and-wait)
;; grab boxes
(while (!= 0 (peek cltin)) (push (last (parse (read-line cltin))) boxes -1))

;; clear last " OK " responce from list
(if (= (last boxes) "completed.") (pop boxes -1))
;; pop the boxes from the list you dont want to be checked
(dolist (dont dont-check) (if (ref dont boxes) (pop boxes (ref dont boxes))))

;; checked every box for unseen messages.
(setq buffer "")
(dolist (box boxes)
        (write-line cltout (append {. STATUS} { } (string box) { } {(UNSEEN)}))
        (setq buffer (read-line cltin))
        (if (find "* STATUS" buffer) ( inc unseen (int ( (parse buffer) -2))))
        (setq buffer (read-line cltin))
)

;; Notify and goodbye
(println "* You have (" unseen ") unseen messages" )
(write cltout ". LOGOUT")
(destroy imaps)
(exit)

#17
Cormullion..where is your online newlisp intepreter?



Im seeking for the code of the protected-function-execute version actualy is that available?..

I lost the solution i had  and i can remember you had one too.. cant find it here on the forum..



;-)
#18
Hi Lutz,



Its perhpas good to have a release note summery. I you where away from newlisp for some time its

hard to catchup with the progress it makes. I think a concatented release-notes.html could help

out a little here.. Its just an idea nothing fancy this one.. But perhaps an idea..



here an example..appended..

http://www.nodep.dds.nl/downloads/newlisp/manual/release-notes.html">http://www.nodep.dds.nl/downloads/newli ... notes.html">http://www.nodep.dds.nl/downloads/newlisp/manual/release-notes.html
#19
Hello Lutz,



I have setup a new layout proposal on the document. I always have an issue with the frames.

Here is my example, perhpas we could use it or extend it? Hope you like it..



http://www.nodep.dds.nl/downloads/newlisp/manual/manual_frame.html">//http://www.nodep.dds.nl/downloads/newlisp/manual/manual_frame.html
#20
Hello Lutz,



Here you can find the updated Joe editor lisp.jsf file. updated upto 10.3.0

(added 2 depr's and 1 prim... replace-assoc and name and term.)

http://www.nodep.dds.nl/downloads/newlisp/lisp-23032011.jsf">//http://www.nodep.dds.nl/downloads/newlisp/lisp-23032011.jsf