timburks/nu — Issue #31: The cblock Macro Does Not Work
Author: sorin-ionescu
Created: 2012-01-08 19:03:47+00:00
State: open

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.

```lisp
#!/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)))
```

```text
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 :-1: in NuBridgedFunction
from :-1: in (NuBridgedFunction functionWithName: "signature_for_identifier" signature: "@@@")
from :-1: in ((NuBridgedFunction functionWithName: "signature_for_identifier" signature: "@@@") identifier (NuSymbolTable sharedSymbolTable))
from :-1: in g1804289383__get_type_signature
from :-1: in set
from :-1: in progn
from :-1: in bridgedblock
from :-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
```