-- move <resource-stream> from parser\r
- quit responder breaks with multithreading\r
- nicer way to combine two paths\r
-- -1.1 3 ^ shouldn't give a complex number\r
- don't show listener on certain commands\r
- plugin should not exit jEdit on fatal errors\r
- wordpreview: don't show for string literals and comments\r
- introduce ifte* and ?str-head/?str-tail where appropriate\r
- namespace clone drops static var bindings\r
- solaris: -lsocket -lnsl\r
-- unparsing: \u000c\r
\r
+ bignums:\r
\r
\r
- NPE in activate()/deactivate()\r
- NPE in ErrorHighlight\r
-- caret at start of word: problem\r
-- don't use jEdit's word finding API\r
- some way to not have previous definitions from a source file\r
clutter the namespace\r
- use inferior.factor for everything not just listener\r
DEFAULT_READTABLE.setCharacterType('\t',ReadTable.WHITESPACE);
DEFAULT_READTABLE.setCharacterType('\n',ReadTable.WHITESPACE);
-
- // ^L
- DEFAULT_READTABLE.setCharacterType((char)12,ReadTable.WHITESPACE);
-
DEFAULT_READTABLE.setCharacterType('\r',ReadTable.WHITESPACE);
DEFAULT_READTABLE.setCharacterType(' ',ReadTable.WHITESPACE);
if(caret == line.length())
caret--;
- String noWordSep = textArea.getBuffer().getStringProperty(
- "noWordSep");
- int wordStart = TextUtilities.findWordStart(line,caret,
- noWordSep);
- int wordEnd = TextUtilities.findWordEnd(line,caret,
- noWordSep);
- return line.substring(wordStart,wordEnd);
+ ReadTable readtable = ReadTable.DEFAULT_READTABLE;
+
+ if(readtable.getCharacterType(line.charAt(caret))
+ == ReadTable.WHITESPACE)
+ {
+ return null;
+ }
+
+ int start = caret;
+ while(start > 0)
+ {
+ if(readtable.getCharacterType(line.charAt(start - 1))
+ == ReadTable.WHITESPACE)
+ {
+ break;
+ }
+ else
+ start--;
+ }
+
+ int end = caret;
+ do
+ {
+ if(readtable.getCharacterType(line.charAt(end))
+ == ReadTable.WHITESPACE)
+ {
+ break;
+ }
+ else
+ end++;
+ }
+ while(end < line.length());
+
+ return line.substring(start,end);
} //}}}
//{{{ showStatus() method
! Power-related functions:
! exp log sqrt pow
+USE: logic
: exp >rect swap fexp swap polar> ;
: log >polar swap flog swap rect> ;
[ [ >rect ] dip flog * swap ] dip * + ;
: ^ ( z w -- z^w )
- swap >polar 3dup ^theta [ ^mag ] dip polar> ;
+ over real? over integer? and [
+ fpow
+ ] [
+ swap >polar 3dup ^theta >r ^mag r> polar>
+ ] ifte ;
: run-file ( path -- )
parse-file call ;
-: <resource-stream> ( path -- stream )
- <rreader> f <char-stream> ;
-
: parse-resource* ( resource -- list )
dup <rreader> swap "resource:" swap cat2 swap parse-stream ;
-: parse-resource ( file -- )
+: parse-resource ( resource -- list )
#! Override this to be slightly more useful for development.
global [ "resource-path" get ] bind dup [
swap cat2 parse-file
#! Accept a connection from a server socket.
[ "socket" get ] bind
[ ] "java.net.ServerSocket" "accept" jinvoke <socket-stream> ;
+
+: <resource-stream> ( path -- stream )
+ <rreader> f <char-stream> ;
#! the current interactive interpreter.
(parse-file) call ;
-: resource-path ( -- path )
- "resource-path" get [ "." ] unless* ;
-
-: <resource-stream> ( path -- stream )
- resource-path swap cat2 <filecr> ;
-
: parse-resource ( path -- quot )
#! Resources are loaded from the resource-path variable, or
#! the current directory if it is not set. Words defined in
#! Copy the contents of the fd-stream 'from' to the
#! fd-stream 'to'.
[ 2dup (fcopy) ] [ -rot fclose fclose rethrow ] catch ;
+
+: resource-path ( -- path )
+ "resource-path" get [ "." ] unless* ;
+
+: <resource-stream> ( path -- stream )
+ resource-path swap cat2 <filecr> ;
{
struct timeval t;
gettimeofday(&t,NULL);
- dpush(tag_object(s48_long_to_bignum(
- t.tv_sec * 1000 + t.tv_usec/1000)));
+ dpush(tag_object(s48_long_long_to_bignum(
+ (long long)t.tv_sec * 1000 + t.tv_usec/1000)));
}
void primitive_init_random(void)