programming-nu / nu Goto Github PK
View Code? Open in Web Editor NEWNu is an interpreted Lisp that builds on the Objective-C runtime and Foundation framework.
Home Page: http://programming-nu.github.io
License: Apache License 2.0
Nu is an interpreted Lisp that builds on the Objective-C runtime and Foundation framework.
Home Page: http://programming-nu.github.io
License: Apache License 2.0
This is the source material for the Programming Nu website. It includes the text of the site and build scripts. All contents copyright 2007-2008, Neon Design Technology, Inc. Build scripts are released under the Apache License, v. 2.0. See the LICENSE file for details. Text is released under the Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License. == To build the site, just run "nuke". Building requires NuMarkdown and NuYAML. Both are available on github. To preview the site, run "nuke preview". This requires Nunja, which is also available on github.
It's organic to determine the fickle pattern within the style globe. Obviously, it's with numerous modifications within the trendy see for men and ladies. These days, it's turn out to be well-known stating that men?s style style ought to rely on branded view, and ladies?s style style would depend on their consuming style on purse options. For each fashionable lady, the image of statue and style style ought to be all sorts of leather bags. So, allow?s take a look at the symbolic ladies?s bags to any extent further.
If you're attracted by Latin design from charming girls like Beyance, you've to decide on the leather bags in easy and generous design. This kind of brave woman might favor selecting the bags with handy perform and easy styles. If you're insane for open-minded Hollywood design, Reese Witherspoon could be the beautiful instance you need to adhere to. A standard bag style in darkish colour with woman style could be so sophisticated and classical for individuals to take.
In contemporary culture, leisure clothing would meet recognition from eye-catching bag styles. This kind of brave and glamorous bag styles could be useful for them to launch operating stress. Just using Jessica Simpson for instance, a leisure-style suite and deluxe LV purse would type a charming and irresistible dressing design. What?s much more, Nicolette Sheridan could be an additional excellent style star to lead the pattern of beautiful purses. Her benefit would be to take advantage of sports activities dressing assortment in pure white with white bag. The calming bag for every day sporting might also enhance for correct style style. From her distinctive dressing design, this kind of white bag could be essential merchandise within the wardrobe of fashionable lady.
Ladies could be usually creating complete utilization of colorful artwork. LV in cherry design could be surprising for your style marketplace. This kind of adorable and beautiful cherry-style has introduced out tantalizing style wave. Even when creating utilization of the easy clothes, this kind of eye-catching purse would raise up a visual impact for your entire dressing picture. In the event you favor the awesome summer-style dressing, a sensible and handy purse in leather and canvas could be the great business for travelling.
Checking the purse assortment from Nadine Coyle, the easy vest might replicate her wholesome pores and skin colour. Simultaneously, the low-key dressing and Prada classical purse would meet ideal cooperation on colour and stylish perception. Within the contemporary culture, increasingly more ladies adore attempting the wild perception with leopard pores and skin and golden hair. Consequently, the leather bags from Kate Moss could be the queen-style style in men?s eyes. Blue Balenciaga ladies?s bags could be using the design for metro ladies using the chilly and stylish perception.
asaS
The dmg is not working on 10.7. When running nush
the error
$ nush -i
Illegal instruction: 4
is reported. According to stackoverflow is it due to the bin being compiled for a later OS-version.
Would it be possible to compile Nu 2.1 for 10.7 or can I find an older bin that works with 10.7?
I'm kind of blindly poking around, but I'm guessing this isn't supposed to happen:
gort:nu clay$ nush
Nu Shell.
% (help load)
Bus error
"-" and "+" are much more concise and idiomatic for Objective-C users.
Nu builds fail on ARM-based Macs:
objc/NuBridge.m:1242:6: error: implicit declaration of function
'ffi_prep_closure' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
if (ffi_prep_closure(closure, cif, objc_calling_nu_method_handle...
^
1 error generated.
make: *** [objc/NuBridge.o] Error 1
This appears to be already fixed for iOS.
I saw that is <b>blahblah</b>
used for bolding text in this project. It's better to use **blahblah**
. ๐
The web site appears not to have been updated in forever. For example, it says the current version is 2.1.0 from April 14, 2013, and it links to the repositories at their old GitHub location.
It claims to not be able to find signature_for_identifier
.
It would be helpful if blocks would just work like in MacRuby. I do not wish to distinguish between Nu blocks and Objective-C blocks.
#!/usr/bin/env nush
(load "nu")
(load "cblocks")
(set myList '("one" "two" "three"))
(set myArray (myList array))
(puts "each: works")
(myList each:
(do (obj)
(puts obj)))
(puts "cBlockWithNuBlock: works")
(myArray enumerateObjectsUsingBlock:
(NuBridgedBlock cBlockWithNuBlock:
(do (obj idx stop)
(puts obj))
signature:"v@I^?"))
(puts "cblock: fails")
(myArray enumerateObjectsUsingBlock:
(cblock void ((id) obj (unsigned long) idx (BOOL*) stop)
(puts obj)))
each: works
one
two
three
cBlockWithNuBlock: works
one
two
three
cblock: fails
Nu uncaught exception: NuCantFindBridgedFunction: dlsym(RTLD_DEFAULT, signature_for_identifier): symbol not found
If you are using a release build, try rebuilding with the KEEP_PRIVATE_EXTERNS variable set.
In Xcode, check the 'Preserve Private External Symbols' checkbox.
from <TopLevel>:-1: in NuBridgedFunction
from <TopLevel>:-1: in (NuBridgedFunction functionWithName: "signature_for_identifier" signature: "@@@")
from <TopLevel>:-1: in ((NuBridgedFunction functionWithName: "signature_for_identifier" signature: "@@@") identifier (NuSymbolTable sharedSymbolTable))
from <TopLevel>:-1: in g1804289383__get_type_signature
from <TopLevel>:-1: in set
from <TopLevel>:-1: in progn
from <TopLevel>:-1: in bridgedblock
from <TopLevel>:-1: in (bridgedblock (obj idx stop) (puts obj) ())
from ./test.nu:23: in cblock
from ./test.nu:22: in myArray
from /Library/Frameworks/Nu.framework/Resources/help.nu:136: in progn
A unit test fails on Big Sur and Catalina.
TestBridgeSupport: running
--- testConstants
--- testEnumsfailure: NSGreaterThanComparison expected '4' got '0'
This is related to code in objc/NuBridgeSupport.m that reads the value of enums from a "value" field.
In /System/Library/Frameworks/Foundation.framework/Resources/BridgeSupport/Foundation.bridgesupport
we see that the name of the field has changed:
<enum name='NSGreaterThanComparison' value64='4'/>
Hi there, love the idea of Nu, can't wait to try it out!
I don't know whether this should be reported here or over in Homebrew, but I thought I'd let you know.
brew install nu
fails, with this as the error log:
==> Downloading https://github.com/timburks/nu/archive/v2.1.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/nu-2.1.1.tar.gz
==> Verifying nu-2.1.1.tar.gz checksum
tar xf /Library/Caches/Homebrew/nu-2.1.1.tar.gz
==> make
/usr/bin/clang -g -Wall -DMININUSH -DMACOSX -DDARWIN -fobjc-exceptions -I/usr/include/ffi -I./include -c objc/Nu.m -o objc/Nu.o
/usr/bin/clang -g -Wall -DMININUSH -DMACOSX -DDARWIN -fobjc-exceptions -I/usr/include/ffi -I./include -c main/main.m -o main/main.o
objc/Nu.m:5934:12: warning: incompatible pointer types returning 'NSObject<NSCopying,NSSecureCoding,NSCoding,NSObject> *' from a function with result type 'NSString *' [-Wincompatible-pointer-types]
return m ? [NSString stringWithCString:(sel_getName(method_getName(m))) encoding:NSUTF8StringEncoding] : [NSNull null];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
objc/Nu.m:11246:22: warning: incompatible pointer types assigning to 'NSArray *' from 'NSSet *' [-Wincompatible-pointer-types]
voidHTMLElements = [[NSSet setWithObjects:
^ ~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/objc/NSObject.h:35:1: note: instance method 'retain' is assumed to return an instance of its receiver type ('NSSet *')
- (id)retain OBJC_ARC_UNAVAILABLE;
^
2 warnings generated.
/usr/bin/clang objc/Nu.o main/main.o -g -Wall -DMININUSH -DMACOSX -DDARWIN -o mininush -framework Cocoa -lobjc -lreadline -L/usr/lib -lffi
==> ./mininush tools/nuke
error: garbage collection is no longer supported
Using Nukefile with target default.
nuke: mkdir 'Nu.framework'
nuke: mkdir 'Nu.framework/Versions'
nuke: mkdir 'Nu.framework/Versions/A'
nuke: mkdir 'Nu.framework/Versions/A/Resources'
nuke: cd Nu.framework/Versions; ln -sf A Current
nuke: cd Nu.framework; ln -sf Versions/Current/Headers Headers
nuke: cd Nu.framework; ln -sf Versions/Current/Resources Resources
nuke: cd Nu.framework; ln -sf Versions/Current/Nu Nu
nuke: mkdir 'Nu.framework/Versions/A/Resources/English.lproj'
nuke: cp -R 'share/nu/resources/English.lproj/MainMenu.nib' 'Nu.framework/Versions/A/Resources/English.lproj/'
nuke: cp 'nu/menu.nu' 'Nu.framework/Versions/A/Resources/menu.nu'
nuke: cp 'nu/coredata.nu' 'Nu.framework/Versions/A/Resources/coredata.nu'
nuke: cp 'nu/match.nu' 'Nu.framework/Versions/A/Resources/match.nu'
nuke: cp 'nu/beautify.nu' 'Nu.framework/Versions/A/Resources/beautify.nu'
nuke: cp 'nu/cocoa.nu' 'Nu.framework/Versions/A/Resources/cocoa.nu'
nuke: cp 'nu/generate.nu' 'Nu.framework/Versions/A/Resources/generate.nu'
nuke: cp 'nu/bridgesupport.nu' 'Nu.framework/Versions/A/Resources/bridgesupport.nu'
nuke: cp 'nu/nu.nu' 'Nu.framework/Versions/A/Resources/nu.nu'
nuke: cp 'nu/math.nu' 'Nu.framework/Versions/A/Resources/math.nu'
nuke: cp 'nu/console.nu' 'Nu.framework/Versions/A/Resources/console.nu'
nuke: cp 'nu/help.nu' 'Nu.framework/Versions/A/Resources/help.nu'
nuke: cp 'nu/doc.nu' 'Nu.framework/Versions/A/Resources/doc.nu'
nuke: cp 'nu/test.nu' 'Nu.framework/Versions/A/Resources/test.nu'
nuke: cp 'nu/cblocks.nu' 'Nu.framework/Versions/A/Resources/cblocks.nu'
nuke: cp 'nu/fscript.nu' 'Nu.framework/Versions/A/Resources/fscript.nu'
nuke: cp 'nu/nibtools.nu' 'Nu.framework/Versions/A/Resources/nibtools.nu'
nuke: cp 'nu/template.nu' 'Nu.framework/Versions/A/Resources/template.nu'
nuke: mkdir 'Nu.framework/Versions/A/Headers'
nuke: /usr/bin/clang -Wall -g -fPIC -O2 -DMACOSX -DHAVE_CONFIG_H -fobjc-exceptions -fobjc-gc -arch x86_64 -I/usr/include -I./include -I./include/Nu -I/usr/include/ffi -c -o build/x86_64/Nu.o objc/Nu.m
nuke: terminating on command error (return code 1)
==> Configuration
HOMEBREW_VERSION: 0.9.5
HEAD: 324ae85323666a8fdc6d61a7bf76b9fd4307dbfc
CPU: quad-core 64-bit haswell
OS X: 10.9.3-x86_64
Xcode: 5.1.1
CLT: 5.1.0.0.1.1396320587
X11: 2.7.5 => /opt/X11
==> ENV
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j4
CMAKE_PREFIX_PATH: /usr/local
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_PATH: /usr/local/opt/pcre/lib/pkgconfig
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.9
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Library/ENV/4.3:/usr/local/opt/pcre/bin:/usr/bin:/bin:/usr/sbin:/sbin
Logs:
/Users/josh/Library/Logs/Homebrew/nu/01.make
/Users/josh/Library/Logs/Homebrew/nu/02.mininush
Am I doing something wrong, or missing something?
I see this line in DEBIANINSTALL
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.9.tar.gz
That link is wrong. Can you set new link? Something like this โ http://switch.dl.sourceforge.net/project/pcre/pcre/7.9/pcre-7.9.tar.gz
UPDATE: I submitted fix โ https://github.com/ZDroid/nu/blob/master/notes/OBSOLETE/DEBIANINSTALL
Thanks in advance.
Trying to install from the current version of the git repo, I get the following behavior (on a MacBook Pro, running 10.5.7):
Ta.
... with info on (load "MyFramework")
Nu v 2.1.0 installer. Mac OS X 10.7.5. Will dig deeper if requested.
I'm testing my nu installation at the moment. After using ./mininush tools/nuke install
to install nu, I'm trying to use ./mininush tools/nuke uninstall
to uninstall but with no luck. What's the correct way to uninstall nu?
It's not Nu, it's Ni. Back of the throat.
jhhjhjjh
Nu should only require Foundation. Currently it contains a few hacks and extensions to Cocoa, but these add little value and add an extra dependency for embedded applications.
We've recently worked on packing nu
for Linux in Homebrew: Homebrew/homebrew-core#104928. We are using libobcj2
to provide a more modern Objective-C runtime than the one that comes with GCC. Nu builds with no issues using libobjc2
, but it does require us to manually remove the -DGNU_RUNTIME=1
and -fgnu-runtime
flags from the Nukefile because they are hardcoded when building on Linux.
Could a flag or environment variable be added that would allow the user to skip these flags, even if they are enabled by default? This is more convenient than having manually edit the file.
Philip White has already done some work on this. I'd like to review that and merge or update it.
Here is too much non-needed branches. Please do something for that. ๐
My recommendation - just keep master and gnustep (currently gnustep-libobjc2, but can be merged in gnustep).
I have a simple question. How to install Nu on Ubuntu 12.04?
DEBIANINSTALL
is outdated. That doesn't work. Also tried manual metods but nothing. Nu isn't here.
If there isn't any method to install Nu on Linux, please improve support for Linux distributions.
Update objc/Nu.m
This repo has been modified by github's web browser editor at a point where it wrote corrupt git objects to the repo.
These trees are broken:
18:52:28 banana:~/Dev/iphone2/vendor/nu nevyn (master)$ git fsck --full
warning in tree 16bfc00c112096d096440f1b6281e8cdfd7d9dbc: contains zero-padded file modes
warning in tree 2698c6c49d55b360bc2fec7ede772da12cb4680f: contains zero-padded file modes
warning in tree 29f760a8f4d2577ed50ba1dab6cb0e214a664151: contains zero-padded file modes
warning in tree 32cbdd8d58c9731c460a1563237c8aeac26877ef: contains zero-padded file modes
warning in tree 3eb4a46becf98642255c9916b2fe0d7fea7b004f: contains zero-padded file modes
warning in tree 4479a800ea37bbc6950126f42bee6d1747efe20c: contains zero-padded file modes
warning in tree 4f8329ae933a3fdb10920d9ca25f7f6f8b144bd4: contains zero-padded file modes
warning in tree 7a2dc8c2ec60756f9c61340875e96862cb34149f: contains zero-padded file modes
warning in tree ddf9dcc2d2a905e9246cc4f2e92af7be44a47241: contains zero-padded file modes
warning in tree e11e24ecde5c6691aa46d95e6ad43f05422ad420: contains zero-padded file modes
warning in tree ee6e690c3dbce7e7678b477cb9b2ebf62cb6121c: contains zero-padded file modes
warning in tree f04f920a90c4db7063cbeed339bff941d82122de: contains zero-padded file modes
This means that the repository can't be pushed to a git server that is less forgiving about errors. (I'm trying to fork all my external dependencies (so we can keep building even if github or bitbucket is down), and failing to push the fork to gerrit).
The only way to fix it is to rewrite the tree, which will be very annoying for all forks with outstanding changes. If you still want to go through with it, instructions can be found in this mailing thread:
http://thread.gmane.org/gmane.comp.version-control.git/143288
I ran Ubuntu.sh
script, removed Foundation.h
include in Nu.h
and Nu.m
files, than ran make
(from gnustep-libobjc2
branch). This is output (20 errors on Ubuntu 12.04 desktop):
clang -g -O0 -Wall -DMININUSH -I/usr/include/GNUstep -DLINUX -fobjc-exceptions -fconstant-string-class=NSConstantString -fobjc-nonfragile-abi -fblocks -MMD -MP -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -fexceptions -fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS -pthread -fPIC -DDEBUG -fno-omit-frame-pointer -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -g -fgnu-runtime -I. -I/home/zlatan/GNUstep/Library/Headers -I/usr/local/include -I./libffi/include -I./include -I/usr/local/include -c objc/Nu.m -o objc/Nu.o
In file included from objc/Nu.m:74:
objc/Nu.h:41:33: error: cannot find protocol declaration for 'NSCoding'
@interface NuSymbol : NSObject <NSCoding, NSCopying>
^
objc/Nu.h:41:43: error: cannot find protocol declaration for 'NSCopying'
@interface NuSymbol : NSObject <NSCoding, NSCopying>
^
objc/Nu.h:41:23: error: cannot find interface declaration for 'NSObject',
superclass of 'NuSymbol'
@interface NuSymbol : NSObject <NSCoding, NSCopying>
~~~~~~~~~~~~~~~~~~~ ^
objc/Nu.h:48:4: error: expected a type
- (NSString *) stringValue;
^
objc/Nu.h:50:4: error: expected a type
- (bool) isLabel;
^
objc/Nu.h:52:4: error: expected a type
- (bool) isGensym;
^
objc/Nu.h:54:4: error: expected a type
- (NSString *) labelName;
^
objc/Nu.h:56:25: error: expected a type
- (id) evalWithContext:(NSMutableDictionary *) context;
^
objc/Nu.h:58:4: error: expected a type
- (NSComparisonResult) compare:(NuSymbol *) anotherSymbol;
^
objc/Nu.h:60:4: error: expected a type
- (NSString *) description;
^
objc/Nu.h:70:28: error: cannot find interface declaration for 'NSObject',
superclass of 'NuSymbolTable'
@interface NuSymbolTable : NSObject
~~~~~~~~~~~~~~~~~~~~~~~~ ^
objc/Nu.h:75:34: error: expected a type
- (NuSymbol *) symbolWithString:(NSString *)string;
^
objc/Nu.h:77:24: error: expected a type
- (NuSymbol *) lookup:(NSString *) string;
^
objc/Nu.h:79:4: error: expected a type
- (NSArray *) all;
^
objc/Nu.h:100:31: error: cannot find protocol declaration for 'NSCoding'
@interface NuCell : NSObject <NSCoding>
^
objc/Nu.h:100:21: error: cannot find interface declaration for 'NSObject',
superclass of 'NuCell'
@interface NuCell : NSObject <NSCoding>
~~~~~~~~~~~~~~~~~ ^
objc/Nu.h:115:4: error: expected a type
- (NSMutableString *) stringValue;
^
objc/Nu.h:117:25: error: expected a type
- (id) evalWithContext:(NSMutableDictionary *)context;
^
objc/Nu.h:119:4: error: expected a type
- (bool) atom;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [objc/Nu.o] Error 1
When building NuApp for device, works fine when building for simulator or an older SDK.
At the end of notes/OBSOLETE/DEBIANINSTALL
:
make
./mininush tools/nuke
./mininush tools/nuke install
nuke
nuke install
# can't copy over running image in Linux
sudo cp libNu.so /usr/local/lib
sudo cp nush /usr/local/bin
When I do make
zlatan@zdroid:~/Repos/nu$ make
gcc -g -Wall -DMININUSH -DLINUX -fobjc-exceptions -MMD -MP -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -fexceptions -fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS -fPIC -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -g -O2 -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -fgnu-runtime -I. -I/home/zlatan/GNUstep/Library/Headers -I/usr/local/include/GNUstep -I/usr/include/GNUstep -I./libffi/include -I./include -I/usr/local/include -c objc/Nu.m -o objc/Nu.o
objc/Nu.m:28:31: fatal error: AvailabilityMacros.h: No such file or directory
compilation terminated.
make: *** [objc/Nu.o] Error 1
So AvailabilityMacros.h
doesn't exist.
I notice that you are publishing versioned releases on http://programming.nu/ but in the Git repo there is no tag for the version. Having either tagged source releases in tarballs or having tags inside the Git repo would be helpful to package managers (Homebrew for example).
An even better target than Objective-C, feature- and structure-wise.
Swift is great, but without homoiconicity, true macros and prefix notation, how can anything than Clojure/Lisp be my favorite language :)
Hi! In README i find
Radtastical i Inc.
It's in LEGAL.
Should not be
Radtastical Inc.
Thanks in advance.
When I try to access the page http://programming.nu
, I get a server not found error. Is this just temporary, or what?
Hi, I hope you can create an easier life for packagers, can you provide a tarball download link on website?
Like http://github.com/downloads/timburks/nu/nu-2.1.0.tar.gz ?
Thanks.
64-bit arm is handling va_list methods differently than standard argument methods. Thus calling into a nu-defined method will not work due, as the method call with setup a standard register/stack setup, but the handler will expect a va_list register/stack setup.
It could be possible to use the invocation mechanism instead and store method associated nu-blocks inside inside a dict of a nu (or any) class. This change would additionally allow the later addition of methods after class creation.
There are two trivial warnings preventing a compile with -Werror in Nu.m:
--- a/Examples/Support/objc/Nu.m
+++ b/Examples/Support/objc/Nu.m
@@ -6227,7 +6227,7 @@ static void nu_markEndOfObjCTypeString(char *type, size_t len)
- (NSString *) stringValue
{
- return [NSString stringWithFormat:@"<%s:%x>", class_getName(object_getClass(self)), (long) self];
+ return [NSString stringWithFormat:@"<%s:%p>", class_getName(object_getClass(self)), self];
}
- (id) car
@@ -10259,7 +10259,7 @@ static NSUInteger nu_parse_escape_sequences(NSString *string, NSUInteger i, NSUI
- (NSString *) description
{
- return [NSString stringWithFormat:@"name:%@ start:%f", name, start];
+ return [NSString stringWithFormat:@"name:%@ start:%llu", name, start];
}
@end
However, the bigger problem is that ffi.S won't assemble, with the error that "stmeqia r2, {r0, r1}" around line 208 is an invalid instruction. I suck at assembler, so I just couldn't understand from the documentation what the difference between stmeqia and stmib is, so I just switched the former for the latter to get it to compile. I'm guessing that's the wrong solution...
This probably means that these problematic classes override handleUnknownMessage:withContext: and do not call super.
These classes include, but may not be limited to:
I'll take a look at this myself, but I've created this ticket as a reminder, as I'll have to do a concise pass over the complete source to see what other classes might need to be fixed as well.
โ ~ nush
Nu Shell.
% (or NO NO NO)
()
Is this a bug or a feature?
(set a (NSMutableArray array))
(a addObject:1)
(a addObject:5)
(a addObject:7)
(a addObject:2)
(a addObject:1)
(a addObject:9)
(a addObject:0)
(set b (a sortedArrayUsingComparator: (do (a b)
(puts a b)
)))
the code will cause a crash, is it possible to use cocoa block based api ?
Would it be worth it and possible?
In the code bellow, Nu does not like printSongInformation: (NSNotification) notification
. However, if I change it to printSongInformation: (id) notification
, it works fine. (puts (notification class))
prints __CFNotification. I am using version 2.0.1.
2012-01-07 01:45:29.119 nush[63156:d07] I can't bridge this return type yet: (NSNotification) ()
Nu uncaught exception: NSInvalidArgumentException: NSGetSizeAndAlignment(): unsupported type encoding spec '?' at '?' in '?'
from ./iTunes.nu:8: in -
from ./iTunes.nu:7: in class
from /Library/Frameworks/Nu.framework/Resources/help.nu:136: in progn
#!/usr/bin/env nush
(load "Nu")
(load "Foundation")
(load "Cocoa")
(class ApplicationDelegate is NSObject
(- (void) printSongInformation: (NSNotification) notification is
(set information (notification userInfo))
(puts "track information: #{(information description)}"))
(- (void) applicationDidFinishLaunching: (id) sender is
(set dnc (NSDistributedNotificationCenter defaultCenter))
(dnc
addObserver:self
selector:"printSongInformation:"
name:"com.apple.iTunes.playerInfo"
object:nil)))
(set delegate ((ApplicationDelegate) alloc) init)
((NSApplication sharedApplication) setDelegate:delegate)
((NSApplication sharedApplication) run)
Implementing a SWANK backend could be interesting.
hit a problem in nuke test while installing.
TestMacros: running
--- testBrokenFactorialMacro
--- testExceptionInMacro
--- testFactorialFunction
--- testFactorialMacro
--- testGensymInterpolation
objc[94267]: no class for metaclass 0x7f91f2c14ca0
the following code does not seem to work
((view layer) setContents: (bmprep CGImage))
it just does not show anything in a view, although objective-c equivalent is okay
<script src="https://gist.github.com/669310.js"> </script>It should be possible to write mobile apps in Nu due to its ObjC base, am I correct? Could we have some demo GUI apps with sample code?
With upcoming iOS versions the swizzling of NSCFMutableArray's and NSCFMutableDictionary's addObject:
fails, as the class clusters now also have __NSCFMutable*
classes which will not respond to the swizzeled selectors as they were not added.
I only looked into the crashes for 5mins or so there might be more/other causes for it.
Add the method to the other classes could fix that.
In general we could (should?) look into a way to not swizzle the whole programs behaviour with added nils to arrays and only do so in a nu context?
Any ideas/pointers @timburks ?
git clone git://github.com/jsallis/nu-tmbundle.git "Nu.tmbundle"
->
git clone git://github.com/jsallis/nu.tmbundle.git "Nu.tmbundle"
(dash should be period).
Hello there,
i though some Kind of UrlRequestFactory would a great advantage for AFNetworking, because i would cover many more usecases.
A little example to show you what i mean.
@implementation AFHTTPClient (UrlRequestFactory)
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
[request setHTTPMethod:method];
[request setAllHTTPHeaderFields:[self valueForKey:@"defaultHeaders"]];
if (parameters)
{
if ([method isEqualToString:@"GET"] || [method isEqualToString:@"HEAD"] || [method isEqualToString:@"DELETE"])
{
NSString* stringUrl = [url absoluteString];
url = [NSURL URLWithString:[stringUrl stringByAppendingFormat:[stringUrl rangeOfString:@"?"].location == NSNotFound ? @"?%@" : @"&%@", AFQueryStringFromParametersWithEncoding(parameters, self.stringEncoding)]];
[request setURL:url];
}
else
{
NSString *charset = (__bridge NSString *)CFStringConvertEncodingToIANACharSetName(CFStringConvertNSStringEncodingToEncoding(self.stringEncoding));
NSError *error = nil;
switch (self.parameterEncoding)
{
case AFFormURLParameterEncoding:;
[request setValue:[NSString stringWithFormat:@"application/x-www-form-urlencoded; charset=%@", charset] forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:[AFQueryStringFromParametersWithEncoding(parameters, self.stringEncoding) dataUsingEncoding:self.stringEncoding]];
break;
case AFJSONParameterEncoding:;
[request setValue:[NSString stringWithFormat:@"application/json; charset=%@", charset] forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:0 error:&error]];
break;
case AFPropertyListParameterEncoding:;
[request setValue:[NSString stringWithFormat:@"application/x-plist; charset=%@", charset] forHTTPHeaderField:@"Content-Type"];
[request setHTTPBody:[NSPropertyListSerialization dataWithPropertyList:parameters format:NSPropertyListXMLFormat_v1_0 options:0 error:&error]];
break;
}
if (error) {
NSLog(@"%@ %@: %@", [self class], NSStringFromSelector(_cmd), error);
}
}
}
return request;
}
It is just a littlebit modified version of the method requestWithMethod:path:parameters:
i can't see any issues with that, except the network reachability services (which seems to be depending on the baseUrl).
Maybe worth implementing in the next release?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.