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

Messages - dexter

#1
Hello all~~



Recently I developed a few projects using golang



tough and complex languages but golang does not have the thread just like newlisp



but it has microthread ,called channel

and goroutine



to do the concurrent job

which is a new great way



Is it possible that newlisp can have its own newlisp channel and newlisp routine?

like

(channel (<- a b))
(newroutine (func ))


Wouldn't be great if newlisp has these features?
#2
I compiled newlisp on win7 64bit today, found out the makefile for cygwin is outdated



and the configure of newlisp does not care the bits under cygwin



so here is a very little fix for configure

begin line 116

elif [ ${os_type} = CYGWIN ] ; then
  if [ ${memory_model} = LP64 ]; then
  cp makefile_cygwinLP64 makefile_build
  else
  cp makefile_cygwin makefile_build
  fi


and duplicate the makefile_cygwin to makefile_cygwinLP64

and change the arguments -m32 to -m64 in  the new makefile_cygwinLP64



hope to help newlisp to be more perfect

:)
#3
I am running newlisp on raspberry pi

processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 2.00
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 0010
Serial          : 0000000076c41fce



try to write some codes with callback so that I can use newlisp function in C



but callback gave me nagetive address when I try to do it like this:

> (define (cmp a b) (- (get-int a) (get-int b)))
(lambda (a b) (- (get-int a) (get-int b)))
> (set 'func (callback 'cmp "int" "void*" "void*"))
-1225445368
>


because the address is nagetive so I got segment fault everytime exectued



but this code works well on x86 ,so is this a bug or what?



my newlisp is 10.6.2



thanks
#4
thanks



in the end ,I (mul) the number to be an integer,than I can deal the number with (-)
#5

(sub 1.9 0.2) will work as I thought

but (sub 20000.9 20000.2) will not return 0.7 insead of
0.700000000000728



why not just return 0.7 ??



my newlisp is 10.6.0
#6
Oh yeah



Thanks to you all, it works now



:)
#7
I recently met a "problem"



I wrote a newlisp file ,let's say, test1.lsp



then I want the test1.lsp to deal with files in the (main-args) , like


newlisp test1.lsp xxxx.file

In my mind, I thought  newlisp and test1.lsp are together like one binary file

but then I found out , the command "newlisp" will also try to run xxxx.file whatever it is,just a file



I think there is no method can stop this behavior ,right?



so maybe newlisp can have a command line argument,like -f ? to seprate the files need to be executed or just use them as "string argments" ?
#8
newLISP in the real world / Re: newlisp and union
September 05, 2014, 07:54:43 AM
thanks man

Finally I decide to write a share library,.so to wrapper epoll to newlisp



I think newlisp can have epoll support with the net-* functions in the feature.
#9
newLISP in the real world / newlisp and union
September 04, 2014, 08:59:00 PM
I am working on newlisp and epoll



but epoll has this union struct



typedef union epoll_data
{
  void        *ptr;
  int          fd;
  __uint32_t   u32;
  __uint64_t   u64;
} epoll_data_t;

struct epoll_event
{
  __uint32_t   events; /* Epoll events */
  epoll_data_t data;   /* User data variable */
};


How can I translate this union to newlisp's code?
#10
yeah,me,too



Finally, it's the problem of firewall



newilsp is fine as usual
#11
Is the udp of newlisp's net-listen only do for local communications?



Cause I put the udp-server.lsp on a remote server, then use udp-client.lsp to connect

and send something to it



but in the server side, Nothing received, and to the client, it showed works just fine.



So I am wondering, is the udp of newlisp's network  functions only handle with local communications,like in the same network area?



Thanks
#12
I think if these "utf8 "function with a name "utf8_" in the head would less the mess



I know people speak different languages

but today ,most of the operation systems support multi language natively , quiet well



If I split a utf8 string to binary, which will be three bytes , and the print out these bytes, it will be showed as a utf8 string normally



Just a thought :)
#13
I re-compiled newlisp



This is not the first time ,-DSUPPORT_UTF-8 make mess with me





I really don't think new lisp should support utf8 natively , could be based on system, leave utf-8 to system



isn't it better?
#14
newLISP in the real world / Fore nth to not use utf8 ?
January 02, 2014, 09:04:29 PM
Well new lisp support utf8



(nth utf8str index) will return a utf8 string



(slice utf8str 0 1) will return part of a utf8 string, let's say one byte



Why nth works like that?  



And How can I force nth to work without utf8 behaviour? like slice do



without re-compile new lisp?
#15
Thanks



I never noticed (silent)